Jump to content

Updating Sidebar and Footer Across All Pages


BGD

Recommended Posts

Hi again all,

 

I wonder if someone might point me in the right direction?

 

On my site I need to add different images to the side bar and the footer over a period of days (rather than waiting for all to be in and doing at once).

 

I have five or six pages on the site and they all need to have the same template format of header, sidebar, footer all looking the same.

 

I use Dreamweaver CS4.

 

Do I need to update each page individually with each image as I get it and then reupload the whole site each time?? Or if I remove them do the same?

 

Thanks in advance for any steer you can give me.

 

B

Link to comment
Share on other sites

well you could create a simple php class that works as you site layout base. Devide that into function for showing header, body, side bar, footer.

 

then simply calling the class functions on each page, which would be a good way of having all code at one place instead of 6. And if you need changes to the layout on any page it's just a matter of inheriting the main class and applying the changes in a child class.

Link to comment
Share on other sites

well you could create a simple php class that works as you site layout base. Devide that into function for showing header, body, side bar, footer.

 

then simply calling the class functions on each page, which would be a good way of having all code at one place instead of 6. And if you need changes to the layout on any page it's just a matter of inheriting the main class and applying the changes in a child class.

 

Thanks Krillz but that is way above my experience level at the moment. Hopefully by next year when I repeat this I should be on track but this year with the hourglass almost empty I don't believe I can get up to speed on that.

 

I had hoped Library items or something similar might help but my readings eemed to suggest this wasn't suitable for images.

 

Edit: Google Ad Manager looks like it might do the job (although browsers with ad sensitive tools like Firefox might hide them) but once again the sun is low in the sky for me on this.

 

No quick dirty fixes at all?

Edited by BGD
Link to comment
Share on other sites

PHP includes are actually rather simple and even better than those Dreamweaver Library items. You don't need to learn or know any PHP in order to use them, and I never build websites without them any more.

 

Here is an excellent tutorial: http://www.killerphp.com/articles/php-includes/

Link to comment
Share on other sites

PHP includes are actually rather simple and even better than those Dreamweaver Library items. You don't need to learn or know any PHP in order to use them, and I never build websites without them any more.

 

Here is an excellent tutorial: http://www.killerphp.com/articles/php-includes/

 

Erm, thanks as ever Andrea. From what I ascertained from those clips (thanks Stefan too) I can create a sidebar page with all my images as a separate file and then just put the php include text into the main pages and it will theoretically pick it up.

 

So if I have a range of pages already created 1.htm, 2.htm etc do I just rename them 1.php?

 

And if it's not asking too much how do you deal with making sure of the positioning by your correct code placement and naming so that the images land in the correct spot?

Link to comment
Share on other sites

On my site I need to add different images to the side bar and the footer over a period of days (rather than waiting for all to be in and doing at once).

 

Is this a one time period of a few days? If so' date=' yes, wait and upload them separately. :)[/quote']

 

Sadly I can't Eric.

Link to comment
Share on other sites

So if I have a range of pages already created 1.htm, 2.htm etc do I just rename them 1.php?
That is one way to do it. Or you can use the .htaccess to read html pages as php pages, then you don't have to rename anything.
And if it's not asking too much how do you deal with making sure of the positioning by your correct code placement and naming so that the images land in the correct spot?
You determine that with your CSS the exact same way as you would if the code was directly in your pages.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...