Results 1 to 22 of 22
  1. #1

    How to make the navigation bar appear on all pages with out duplicate the content?

    If I want the navigation bar appear on all pages on the left, does that mean I have to duplicate the same navigation code/content on each page? Is there a better solution? Assuming not use programming method like <jsp: include >

    Thanks

  2. #2
    Join Date
    Jan 2003
    Location
    2 Miles High
    Posts
    1,051
    you'll have to include something
    With more success comes more expense!

  3. #3
    you mean use programming language? but what if I just wana a pure html/xhtml based website. Do I have to dup the nav bar in each page?

  4. #4
    I don't think there is a easy way to do this without using server-side language.

    The only workaround in my mind is to write the bar from a js file by using document.write() in javascript. and link to the js file on every page you want to show the nav. I haven't really done this before but it should work theoritically.

  5. #5
    thanks for the reply. So what is the standard way doing that? dup the code?

  6. #6
    with programming language - use include
    w/o programing langauage - dup the code

    I will suggest to use include.

  7. #7
    Just use includes It makes everything way easier IMO.

  8. #8
    well, yes. I would like to use include. But when things just start up(still in design phase). Do we just tell the web designer to use separate page for head, footer, leftNavBar, and everything else. When how do we get the overall look and feel? If everything is separated before programming. How can the web designer know e.g. where to position the shopping cart?

  9. #9
    I don't see why the designers can't use include. If you need these includes anyway, why bother to create different things at the begenning.

    In my company, we usually create programming part first and then designers decorate it. or sometimes designers will create a image of layout at the very beginning stage to express an design impression they pursue.

  10. #10
    Thanks for the rely sexywing.

    include is dynamically generated by the web server. how to let the designer see the whole layout and modifiy it as one piece in the dreamweaver? Or you have other way around it? Also, if you create programming part first, how far will you go? I believe the backend programming can be indenpend from the page, but the stront page, if you don't have the design, how would the programmer know where to put the code.

    We are going to towards whole layer based website. BTW

    Thanks

  11. #11
    Thanks for the rely sexywing.

    include is dynamically generated by the web server. how to let the designer see the whole layout and modifiy it as one piece in the dreamweaver? Or you have other way around it? Also, if you create programming part first, how far will you go? I believe the backend programming can be indenpend from the page, but the stront page, if you don't have the design, how would the programmer know where to put the code.

    We are going to towards whole layer based website. BTW

    Thanks

  12. #12
    Using include is the best way.
    but i think there should be another way.

    Use FRAME or IFRAME. The navigation file is in navigate.html

    All link target = _top

    So once u change code in navigate.html .. all effected.

    But it's not very effective and not so SEO friendly.

    Wish that could help.

  13. #13
    Join Date
    Apr 2006
    Posts
    557
    *shakes head* Don't use an iframe, that's ridiculous. Just use PHP includes for the header, navbar, footer, and anything else that you want to include and may change later.

    Honestly, just a header and footer will do the job, since the navbar is usually in the header. That way, each page you make just has to focus on the content.

  14. #14
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    6
    ummm what about using framesets? you can devide your page to static and dynamic content..

  15. #15
    Join Date
    May 2004
    Location
    Pflugerville, TX
    Posts
    11,222
    Includes have (thankfully) made framesets nearly obsolete. There are many, many reasons why frames should be used only as a last resort, and even then, there are reasons you should just forget what you're trying to do if it absolutely must have frames in it. I would recommend duplicating content ANY day over using frames, which would serve to orphan your pages, break up the continuity of your pages, confuse search engines, confuse some visitors and generally wreck the structural integrity of your site.

    Includes would be the right technology to use here, without any question.
    Studio1337___̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡.__Web Design

  16. #16
    no i won't consider framesets. it is obsolete, and un professional.

  17. #17
    Join Date
    Nov 2004
    Location
    HK
    Posts
    309
    how about SSI?
    Rails in DA - Ruby on Rails plugin for Directdmin | DA-Tomcat - Tomcat Manager plugin for Directdmin
    DA-PgSQL - PostgreSQL plugin for Directdmin | IP Deny Manager - IP Deny Manager plugin for Directdmin
    DeeperAdmin - Manager your DirectAdmin server "deeper"
    Order now at http://www.daplugin.com

  18. #18
    Join Date
    Sep 2006
    Location
    Toronto
    Posts
    8
    If you use php you can set a variable in the main page that modifies the included nav.php to display, say, different colours for the active button.

    Can you do that with a SSI?

  19. #19
    Join Date
    May 2004
    Location
    Pflugerville, TX
    Posts
    11,222
    Quote Originally Posted by beejay
    If you use php you can set a variable in the main page that modifies the included nav.php to display, say, different colours for the active button.

    Can you do that with a SSI?
    No, but as far as I'm concerned, that's a CSS function anyway

    (PHP is still better than SSI, IMHO)
    Studio1337___̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡.__Web Design

  20. #20
    Join Date
    Jan 2006
    Location
    England
    Posts
    463
    if you create the page in a php file instead of html and then where the menu is add <?php include('menufile.html'); ?>

  21. #21
    php is faster use that i do that.

    simply create a file called
    menu.html add the menu content there
    then go to your site pages
    add om
    <?php include('menu.html'); ?>
    Right where the menu would be. When you want to change the menu go to menu.html and change it. it'll appear on all the pages instantly. Be sure to change all the pages the <?php include('menu.html'); ?> is on to .php instead of .html or else it will not work
    WebHostingOpinions.com - Based entirely on web hosting user reviews
    Be heard and submit your review review here.

  22. #22
    Join Date
    Sep 2006
    Location
    Toronto
    Posts
    8
    Quote Originally Posted by the_pm
    No, but as far as I'm concerned, that's a CSS function anyway

    (PHP is still better than SSI, IMHO)
    the_pm, I am not aware of a way to distinguish the current page in a common nav.php using css alone. Do you have a link to a description? I based my navigation on a really nice listomatic css based list, but the current page is noted using a class on the link to the active page. I don't know how one would do that using a common nav.php on all pages without using a php variable.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •