Click to See Complete Forum and Search --> : Help with SNippets


dupreesdiamond
09-17-2003, 01:46 AM
Ok so I have a site of about 25 pages.
I have side-bar of navigation buttons.
I want to add Pop-up Menu's to these navigation buttons (which are in a table)

How can I easily copy this sidebar AND the pop-up menus over to my other pages??

I have tried highlighting the Buttons and saving them as a Snippet which will get the buttons onto the the other pages (with roll-over images working properly) but the Pop-up Menus do NOT pop-up???

Any and all help is greatly appreciated,
Email me (live4bacon@optonline.net)

Thanks,
JP
Email me (live4bacon@optonline.net)

mzanimephp
09-18-2003, 04:51 PM
Just use a PHP include. That way your navigation (& menus) will be the same throughout your entire site, if you ever need to edit the navigation all you have to do is open up that include file, save it, upload it - and boom! its updated for your entire site.

Just make sure the path is a absolute URL, such as:


<?php include("/includes/navigation.php"); ?>


Remember too, if the include contains only HTML & Javascript than you don't need any <?php ?> tags inside the include. Just make its extension .php incase you ever decide to add PHP code to the nav in the future, because you most likely will. :)

Oh yeah.. the include will only work on pages which you've got named .php, but I assumed you have a PHP web site already since your posting on a PHP board.

dupreesdiamond
09-18-2003, 07:39 PM
Well I was oblivious to the fact that this was a Dreamweaver board embedded in a PHP discussion board and have no concept of PHP.

I read through some of the links at the bottom of your post and kind of have an idea of what it is about.

Now in order to use the php code to define my nav buttons and pop-up menus i have to save my "page.html" as "page.php"??

That could be a nasty subject to get into at this point.

If you happen to know of a solution to my problem that I can implement in Dreamweaver that might be best.

Thanks for your previous help (I am now off to teach myself about php)

Thank you,
Johnny P.

If you care to please contact me at:

live4bacon@optonline.net

mzanimephp
09-18-2003, 08:45 PM
PHP is a server-side scripting language than can be embedded into HTML.

And Dreamweaver MX has supposrt for PHP, so as long as your host allows you to use it, then this include method will work.

And yes, your pages will have to be ".php" inorder for your scripts to work. The .php extension lets the server know "oh, this is a PHP page - I'll do what PHP tells me to do, and then send the page down to the user."