Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Building the course template

From: Dynamic Dreamweaver Websites: Creating and Validating Forms

Video: Building the course template

We are now going to build a template page for our website to use as a base for any additional pages we need. And this template page is going to use a concept of includes, to pull in our header image, and our footer image. Let me show you the header image, and that is the file named header scuba. If I open this up, what I actually have on this page, is 2 div tags. So I've added the div tags within the include file.

Building the course template

We are now going to build a template page for our website to use as a base for any additional pages we need. And this template page is going to use a concept of includes, to pull in our header image, and our footer image. Let me show you the header image, and that is the file named header scuba. If I open this up, what I actually have on this page, is 2 div tags. So I've added the div tags within the include file.

So this is all being based on CSS. One is called the header, which is pulling in our header image for the website. The second div is pulling in our nav bar information. So what this page looks like is this without the CSS. Now, all of these navigational pieces, all of these hyperlinks, once we get them onto the main template page. We'll pull in the CSS file and they will be formatted that way. So, they won't look like they do now, in Default view once we actually get them on our template page.

So that is our header scuba, that's the page we want to pull in. So lets open up the template page to do it. Now, our template page is simply a div tag with some page content. So, we have our div tag here for the main content of our page, that's going inside a div called main. So the header include goes above it, the footer goes below it. So, let's go ahead and add this. Now, we need a PHP code block in order to add this, so I'll go up to the PHP tab, click on the Code Block, and Ill add some space in here.

As I said, you don't have to do that, but I think it makes it a little quicker to read, if you need to modify it later, and it'll also make it easier for you to see what I'm doing. So, we need an include parentheses and a semicolon, and I'm going to do that same thing. I'll just copy that code and paste it down in the footer area, that's kind of the skeleton of our code for an include. Now, it's simply a matter of putting the name of the file inside a single quote. So headerscuba.php goes in the header area, and footerscuba.php goes in the footer code.

So, I'll put that in a single quote, and then we're going to put header scuba.php. Now, in Dreamweaver CS5 and 5.5, when I add one single quote, it adds another. If you're in an older version of Dreamweaver, you just need to add both of them. This include here, we're going to do the same thing. This one's going to be footerscuba.php, so you can see it's not that difficult to work with includes. We'll save this file, and let's go out to the browser and make sure it's working correctly.

And there it is, now I don't have much space in here for the page content at this point and time, so our page looks rather silly but as we and page content into this middle section it's going to move our content down. If I go out to design view you'll see it looks identical. And I can open this up a little bit to plug in some code here, and let's put it into live view. My page is having a bit of an issue here because my main div is inside and you can see my closing div for that main.

This main is pulling in a page background and a right border property. So, what I need to do if I want everything included in that, I need to move this closing div tag to a different location. So, you do kind of have to coordinate your CSS along with your PHPPs in order to work with it. Let me move things around the way they should be, I want all of my middle content to go within this main div.

I'll move it down there, let me move my footer comment. Now, this if I move it into the PHP code block, notice I get an error, this is actually an HTML comment. So, this comment should go outside our PHP code block. It can get a bit confusing working with comments initially. So, all HTML has to go outside the PHP block. And I'll pull up my P tag, organize this a little bit better.

Let's get that pulled up. This NBSP this is simply a space. So lets see what our page looks like now. I'll Save this, put it in the Browser, and its completely fixed. So, you must coordinate your CSS pieces along with your PHP code and now I won't have a problem as I add content. To test that out, let's put it into deign view and what I will do is add some information in here. Now, you can see clicking around in here is a bit of an issue, I can't get my cursor in this area.

And I want to point this out now, because it's easy to have this occur. I am actually still in Live view, you have to manually move out of Live view, so I can't edit or do anything in the view. If I click Live view again, you can see it has this little bit of shadow. If I click it again, I have no problem getting my cursor inside this area, and you can see as I move my cursor now, I have no problem with my Page Layout.

So I'll Save this page, we will have some extra paragraphs within here. So, let me back that up just a little bit, so we don't have quite so many, when we go to add content. And there's our New Template page, the basis of all of our pages throughout the website.

Show transcript

This video is part of

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Dynamic Dreamweaver Websites: Creating and Validating Forms.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.