How to Connect 2 Pages
Alright. It's time for a contact us page and we'll link it up with the homepage. They jump across using our navigation. I need, I think I've deleted one of the letters from the contact button. But basically we're gonna duplicate the homepage and I'm gonna show you what need to look out for when you are duplicating pages. And then I'll show you how to link them together in this little video. Let's jump in. Alright, so let's create our contact us page now. I wouldn't go to file new. Okay. And start making a new html page because there's no point typing all this out again. And because our contact us page uses the same logo and the same novel on the top and our sweet dropdown menu. Okay. So there's lots of bits that I want to reuse. Basically, I'm only going to switch out this chunk in the middle. Okay. So these heritage's so index page. Okay, make sure it's selected file servers, give it a new name. I'm gonna call mine. Contact or contact us, make sure that no spaces hyphens or underscore...
s. The only page you have to explicitly call something is index has to be called. Index. Everything else is up to you. Cool. Alright. The first thing you need to do whenever you duplicated pages, change the title, you don't want to pages with the same title. Okay. So it's really hard to know what to put on the contact us page. Just put in the address details, phone number, that type of thing. So if people are searching for real cycles phone number, they might get to the right page without having to go to like the homepage and back out again. Alright, we should be adding our meta description. We haven't done it to this whole website. That's a real big oversight from me. It's one of those things that you need, where it's really good to have but not essential. Okay, so meta descriptions doesn't have a really good shortcut. Okay. It's no like alright, I'm just going to type in meta and hit tab at the moment at least or I can't work out a way to the meta description. You just steal it from an old site. That's what I do. Okay, but it has the same structure is view ports as this kind of one up the top here. So that often is a good kind of way for me to cheat. Okay, so middle name, this one is called description. Okay. And it has the same thing. It says content. Okay. And that's where the description goes and it should be about 150 characters. Okay, so we start talking about the contact details of, I don't know how you write 150 characters. Um Okay what am I doing? I'll speed this up and I'll show you what I put. Alright, I'm back, make sure at the end of your meta description there is a closing angle brackets. Okay, I'm going to turn my rapping on. Okay so I added this stuff so that if there was a search result, Okay, remember our search results. The meta description is this thing is this kind of great stuff here. You know, when you're working on a website, often you don't need to go into a site, you're like, oh, okay, you can find out all the information from the description and what we've done for our people. I need to go back and edit to the index page, which I'm not going to do. I should. Now an interesting thing is who's responsible for this? So let's say it's your you are the owner of raw cycles, you are responsible for writing all the meta descriptions and I find it's easy to do it on the fly. Don't go, I'll do that later on, you'll never do it. Okay. That's been my experience. If you're working with a client asked them or tell them they have to say it's critical. I need the title of every page and tell them the kind of, you know, it needs to be short, it needs to be this many characters, it needs to have this good descriptions in it and you need a corresponding description for every page. Can be a little hard to get meta descriptions that our clients, but your page can live without a description, but it can't live without a title or at least if you wanted to actually rank in any search engine. Alright, let's actually connect the pages so we're gonna need two of them open. I'm going to close down my CSS and I'm going to have the index page and the Contact us page so I'm going to separate them kind of over here. So I got one in the other. So let's connect the say the homepage. Let's connect it when somebody uses this dropdown. While actually uses this. The contact us page because the moment goes, nowhere goes to hash. We only use that pound symbol because it means some browsers. If you click on a button and there's nothing in here, it'll come up with an error and that's not really what you want. Okay, You want to be testing just with no errors. Okay? So let's find our contact us. There it is there instead of hash, we're going to say delete you were going to start typing in contact and hopefully it goes, do you mean this page? You're like, yeah I do. It's safe. Okay, let's preview this in the browser. Okay. We're going to click on it and look at that. We've gone to the contact us page. Nothing's changed. Okay? You see at the top of your, Okay? That changed. So let's make some obvious difference. So let's go to contact us and over here let's say instead of so these two hero boxes I don't want anymore. So there is one. So I'm gonna get rid of everything in the main goodbye let's say that that's a big difference. Let's have a little look now. So let's go back so that my index page, we can click on contact and it jumps to the contact us page. Now we want to get back to the home page. Some pages have home and that's fine. You can have a home button most websites though, you just click on the logo, you might have experienced that. So to add a link to our logo, we're gonna wrap this image in an A tag. Okay, so we're going to wrap it up. We're gonna use our sweet new shortcut. So I'm gonna select, I'm gonna turn rapping on word wrap. Okay, so I'm going to take all of that. I'm going to use command shift P. Or control shift P on a pc wrap with abbreviation. So you might have to type in rap and we're gonna wrap it up in an a tag and I'm not going to give it anything else. I'm just gonna call it a tag, hit, enter on the keyboard so you can see now this fella, I'm gonna separate it out so it makes it easy for you to see. Okay, so this image now is wrapped up in an a tag. Where is it going to go? It's going to go to index. Okay, let's save it and let's have a quick little check. So the logo still actually, let's go back to the homepage. Okay. It's not working. It should have auto saved H. F. You. The image has a lot of it. The image has an a tag wrapped around it, click on it. It does work. Cool. Alright, so we want it to be on both sides. Okay, so at the moment you click on the logo. Okay, on the index page it goes back to the logo, which is not quite what we want. So we're going to grab that whole thing. Okay, so where is it logo starts? No logo starts, there ends there. We're going to copy and paste it to both pages. So where is he logo? There? It is there, it's going to replace that whole thing, so it's on both of them. So now let's give it a go, let's go to our testing. So if I click on contact, you know, connect, I don't even know how long ago I broke that. And let's go back to the homepage. Contact homepage. There is a bit of a drama of like, okay, you do it on one and you got a copy and paste it on both with the navigation is easy enough, right? You can select the whole kind of navigation or this whole chunk or the hole hitter. Okay, okay, grab that whole header and copy and paste it on both. It's not going to be a huge drama for our side because it isn't it's only six buttons. Do we? Potentially only have six or seven or eight pages. All right, the next thing I want to do is actually add some content to our kind of website. We're gonna put it in the main. Now this is gonna run into a problem. Like I'm going to say I did this on purpose. I promise gay we have a problem where main does some stuff. We said main be a height, which is perfectly fine for what I want a minimum height. But we should do some stuff like flex box and center items because we wanted to do some fun stuff on our homepage where we wanted these guys to sit side by side. And so we we did some specific stuff to maine. So the problem is I don't want to do those two main now, but I want to keep using main. So we could either call this one section now in style section over here or we do what every good web designer who gets lost any sort of person anywhere on a computer. Does we end up doing things like, let's just call it main too. And we have another one called Main two over here. You've done it. You've called your thing final. You'd be like, all right. It's my final document. And you call it final. It's like the curse of death, right? You laugh because you've done it. You call it final to even you've got final final on your computer somewhere. I bet. So yeah, sometimes you end up with Maine to now. The thing is we can't call this Main too because maine is an actual html tag like hitter. It's predefined. So we need to call it. You need to do this. You need to say this one is called main too. So it needs to be a div class called maine to. There's a few other ways of doing this. This is what we're going to do for the moment. It's like realism. Also known as bad coding. Alright, so main to what do we want to do for maine to? So here we're gonna style it. The only thing I really want for maine to is to give it a minimum height so it doesn't crush itself. That'll do fine. And I think we need some contact us. We need some probably some padding at the top, but we'll see how it goes. Let's add in here and each one and underneath that a P tag. Okay, let's copy some text from our project to text file. Okay. The H one is called contact us. Can I just take that in there? Con contact us remember. I can't see my fingers and I'm typing hard. All right. You guys you you you alright looking nice and tidy. Let's check it in the browser too close to the top so I might just add mean to you can have some padding at the top please, buddy petting petting top. HM 150 probably too much. Way too much 15. Here we go. So actually before we go, let's just like I guess give you the for instance, so let's ignore this. So let's between men who doesn't exist and we're just using main the main tag again. Okay, so mean this one here needs to end with maine and pre defined pre made and it worked on page one or the homepage, but let's see what it does on this page. You see it's flexing so it means it sticks it side by side and you're like that's not what I want. Okay, so that's why we've got this separate box. I just kind of explained why without actually showing you that kind of bad results. Alright man. Two, let's get on to the next video. We will start looking at forms. It's gonna be a good one. Good long one. It's a good hearty part of the class. Alright. We don't even have to save its auto saving for us. And yeah let's get on to the next video