Go Back   Computer Forums > Web Design | Website Development > Web Programming
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 04-28-2005, 12:17 PM   #1
Beta Member
Join Date: Apr 2005
Posts: 2
Default Dynamic Sidebars

Hey all,
I've yet to find a good explanation of how to achive selected dynamic elements in a website. What I'm looking to do is keep the left (navigation) and right (features, updated daily) nav bars the same on all the pages of my site without changing the code on every page. So, pretty much dynamic objects, as I've been told. But... how does one do this?

I've seen some bad explantions of this in the past, but nothing concrete. If someone could explain an effective way to achive this, I'd be one happy monkey.


Cyberbrak is offline   Reply With Quote
Old 04-28-2005, 02:25 PM   #2
Site Team
root's Avatar
Join Date: Mar 2004
Posts: 7,872
Default Re: Dynamic Sidebars

the easiest way to do this is to just use a dynamic language, (for this example I'll use PHP) and have a wel organised folder structure, again I'll make some suggestions...

First the folder structure, I suggest that you have a root folder (obviously) and in this page you put a file called index.php and a file called menu.html and sidebar.html
inside of the root folder you have a folder caled pages, inside of this folder you put all your content pages. eg, home.html, links.html, gallery.html

now here is the part that achieves what you want to do...

Make the index.php page like this.
(you might want to change the layout etc...)
$page = $_GET['page'];
if ($page=="")
//first start the html layout of the page.
<table width=100%>
    <td colspan=2>";
print "</td>
    <td width=20%>"
print "</td>
print "</td>

now you see that when you browse to the site you automaticall see the page home.html, you make your menu links in the follwing way...
<a href="?page=gallery">View Gallery</a>
<a href="?page=links">Links</a>
Hope that was helpfull, if you don't understand anything or need an example in a differnt languae (web language -I only seak english!) then just ask!

root is offline   Reply With Quote
Old 04-29-2005, 03:30 PM   #3
Beta Member
Join Date: Apr 2005
Posts: 2

Awesome! Thanks for the info. I'm going to give this a shot later tonight, but it looks like that's exactly what I needed.

Cyberbrak is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 12:50 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0