动态子导航

Ive created a portfolio website for myself, there is a gallery which users can enter, click on a thumbnail and then go to a new html page with the full image and description. Now on this full image page i have a list of other fullimage pages for project 2,3,4,5, etc..

But obviously manually updating project2.html to have a list of all other projects minius project 2 in the sub nav is very tedious and mistakes will occus when i have to do it for all 12 plus pages. So im after the page people are viewing not to appear in that sub nav.

My problem is.. Do i scrap the custom html site and move onto a cms.. The logical step for this sort of dynamic nav. Or do i try and include php if possible. Can anyone suggest the best approach for this, im aware it might in the longrun be easier to run off a cms but i do like the control i get and knowledge i hand crafted my html.

Thanks Mat

If you wanted to do this with php, you could do so by making a single file containing the navigation, for example nav.html:

<a href="project1.php">Project 1</a>
<a href="project2.php">Project 2</a>
<a href="project3.php">Project 3</a>

all the project pages would then need to be php files, with the appropriate .php extension, and in each of them you would have:

<p>All your normal page html about the project and such that's above your navigation</p>
<?php
    include("nav.html");
?>
<p>Anything underneath your navigation</p>

Alternatively, the CMS is a viable choice, or if you particularly fancied learning some php, you could actually code a perfectly servicable system to do this without too much trouble yourself.

If your don't want to use CMS , you can create a php file to handle requests for example , a php file that receive this request :

http://myfolio.com/moreinfo.php?album_id=1&

now in the php file you can get informatin from DB and folders then create a HTML Stream and then output it.