On 2/2/12 2:38 PM, Philip TAYLOR wrote:
john wrote:
Can somebody point me to a tutorial that shows how to put a menu into it's own page, the advantage that you edit/adjust once, and all pages are updated, rather than editing the menu on each page.

Tutorial ?  Sorry, no.  Suggestions ?  A few ::

    Dreamweaver templates and library files;
    Server-side includes;
    XMLHttpRequest

Philip Taylor

Philip,

Surprised you would suggest Dreamweaver templates? Headache for me.
The PHP includes from the Webdesign list was a great solution!

From Tedd for John:

1. Create a navigation snip-it, such as:

<div id="navcol">
        <ul>
                <li><a href="home.php">home</a></li>
                <li><a href="about.php">about us</a></li>
                <li><a href="contact.php">contact us</a></li>
        </ul>
</div>


2. Save the code as "menu.php" as-is (i.e., no header or anything else).

3. Change your index page suffix from ".html" to ".php".

4. In your new index.php page replace the navigational code with:

<?php include('menu.php'); ?>

5. Launch your Browser and inspect the source code for the new index page -- 
the menu code will be there.

6. Now, repeat on every page in your site and you'll have one menu file.

Here's an example:

http://sperling.com/examples/include-demo/

Follow that demo and I think you'll never do it the old way again.

Cheers,

tedd

--------------------

Sorry if copying one persons response to another list is a bad thing.

Eric





______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to