CSS Menu not Dynamic??? - Page 1

User 1997052 Photo


Registered User
85 posts

Hi,

I am trying to understand the CSS Menu Designer.

When I change the Menu (ie adding new item), do i have to open all the pages I already built? Because it cannot be totally dynamic since I add code in my template like:

I hoped to have a central menu file which I only need to change once when adding a new article?

For me it seems like I have to have my menu complete before I write the first page?

Do I have to reopen all the "old" pages when I am adding a menu item?

Am I wrong?


Thank you

Daniel
Daniel P.
Germany
the answer is 42
User 364143 Photo


Guest
5,410 posts

You have to paste the new code into every page that you want the new menu inserted into each time you change the menu items.
CoffeeCup... Yeah, they are the best!
User 1997052 Photo


Registered User
85 posts

Hi Tom,

thanks


So it would be best to have the actual menu done before doing the site?

Thanks

Daniel
Daniel P.
Germany
the answer is 42
User 38401 Photo


Senior Advisor
10,951 posts

Hiya Daniel,

Only if it's a totally live site, then yes you should try to have the menu done first. The nice thing is though you can just copy and paste the entire menu text from page to page so that's not too bad. I don't use a CSS menu myself, I've been meaning to try to convert mine to CSS but I haven't done so yet. One of these years I'll take some time and mess with it.

I would also imagine there is probably a way to stick that menu into the CSS system so that it can be changed in the CSS file rather than in the main pages, but I haven't looked into any of that yet either.

If the site isn't totally live yet though, just create away whatever, if people don't need to be on it yet then it don't matter which part you do first. Also, one easy way of doing it is that if you know the page structure you plan to use, then just create all the pages as blank html pages (basic html code only) and put your menu on them and then away you go. Put a note on each page that it's coming soon or something and that way you can be sure all works well with your menu too.

Good luck on it :)
User 1997052 Photo


Registered User
85 posts

Hi Jo Ann and Tom,

thank you!!! That was very helpful

An idea trhat just came to me is that I probably could use replace to change all my sites at once? and then reupload them?

Thank you

daniel
Daniel P.
Germany
the answer is 42
User 364143 Photo


Guest
5,410 posts

Jo Ann wrote:

I would also imagine there is probably a way to stick that menu into the CSS system so that it can be changed in the CSS file rather than in the main pages, but I haven't looked into any of that yet either.


Nope. The whole point of CSS is seperating content from structure. Content in html and structure in CSS.

You could accomplish this using a scripting language, though. I would just stick to a CSS menu and do the copy/paste thing. Not too time consuming.
CoffeeCup... Yeah, they are the best!
User 627930 Photo


Registered User
5 posts

If your server offers php, it really isn't that hard to use scripting. Put this wherever you want the menu to go:

<?php include_once("menu.inc"); ?>


where "menu.inc" is a plain text file that has your menu code it it. The "include_once" function literally pulls text from one file into another. So you just make changes to the menu.inc file once and it gets pulled in all the pages.

Try it, it's not so bad (and I just started with php a few months ago, so if my explanation isn't technically perfect, please forgive me).

This is what I do on my site.
User 38401 Photo


Senior Advisor
10,951 posts

Thanks Stephen,

I thought I had heard of someone doing that with their menu a while ago too but I couldn't find the post. That helps a lot :)
User 1997052 Photo


Registered User
85 posts

Hi ALL!!

Thanks a lot

Stephen, since I read your post I am experimenting with php

were has menu.inc to go? Same folder? And plain textfile .inc?

Thank you very much

daniel

Daniel P.
Germany
the answer is 42
User 562592 Photo


Registered User
2,038 posts

If i understand your question correctly you want to be able to just update a central menu once when adding new content to the file. You can do this through what is called SSI (or server side includes) If you google this term it will give you instructions on how to do this. Basically you set up one html file with just your menu in it. Then you paste the SSI code in each html document you want the menu to appear. Then when you want to change something or add something to the menu you do not have to do it to every page, just one. :D

Hope this helps.
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com


Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.