Sidebar. Make me a template, maybe.

Do you have a technical question that doesn't really fit a specific console? Want some general info on electronics, hacking, making cookies, etc? Here's the place to ask! Go nuts.

Moderator: Moderators

Post Reply
Kurt_
Portablizer
Posts: 5748
Joined: Thu Nov 24, 2005 10:32 am
Steam ID: kurbert
Location: Ontario, Canada
Contact:

Sidebar. Make me a template, maybe.

Post by Kurt_ »

I need a sidebar for my website that allows me to edit it once, and the edit will be applied to all pages with the sidebar code, instead of adding a small piece of code to EVERY SINGLE PAGE that I want the ONE new link to go to.

I'm sure it's commonplace, but I suck. Help me out. My website is in the 'www' in the link below this post.

An example of what I'm asking.

I want to add a link to a new page "Digital Picture Frame". To do this, I currently need to go through every single page, editing the sidebar on each. With a growing number of pages, this could cause a problem.

Is there something simple, like a 1-2 line piece of code that will look for the html in a separate .txt file or something similar?

Can someone help me out a bit?
Hey, sup?
vb_master
Moderator
Posts: 4793
Joined: Tue Jun 08, 2004 9:52 pm

Post by vb_master »

Do the sidebar in PHP and include the HTML file.
Kurt_
Portablizer
Posts: 5748
Joined: Thu Nov 24, 2005 10:32 am
Steam ID: kurbert
Location: Ontario, Canada
Contact:

Post by Kurt_ »

Can you do it for me? :)
Hey, sup?
Bass Creator
Posts: 300
Joined: Fri Feb 02, 2007 11:51 am

Post by Bass Creator »

a web programer should know this simply

ok here

make a file called sidebar.html
an put this code in all the webpages
<?php include("sidebar.html"); ?>
Reddit
marshallh
Moderator
Posts: 2987
Joined: Sat Sep 10, 2005 2:17 pm
360 GamerTag: marshallh
Location: here and there
Contact:

Post by marshallh »

Or if you're lazy like me just use this:

Code: Select all

<? include 'side.php' ?>
Image
Bass Creator
Posts: 300
Joined: Fri Feb 02, 2007 11:51 am

Post by Bass Creator »

or mabe even

Code: Select all

<? include 'iceCream.php' ?>
Reddit
vb_master
Moderator
Posts: 4793
Joined: Tue Jun 08, 2004 9:52 pm

Post by vb_master »

Bass Creator wrote:or mabe even

Code: Select all

<? include 'iceCream.php' ?>
Image
That was about the stupidest post I have ever read.
Post Reply