Same Menu On Every Page

Discussion in 'HTML' started by Matt White, Aug 10, 2007.

  1. Matt White

    Matt White Guest

    I am creating a page with 2 <div>'s - one is a menu and one holds the
    page content. The menu is the same on every page. What is the best way
    to get the HTML for the menu on every page without putting the full
    source on every page? I'd rather have a separate menu.html file that
    gets loaded into the menu <div> when each page loads. Thanks.
     
    Matt White, Aug 10, 2007
    #1
    1. Advertising

  2. Matt White wrote:

    > I am creating a page with 2 <div>'s - one is a menu and one holds the
    > page content. The menu is the same on every page. What is the best
    > way to get the HTML for the menu on every page without putting the
    > full source on every page? I'd rather have a separate menu.html file
    > that gets loaded into the menu <div> when each page loads. Thanks.


    http://allmyfaqs.net/faq.pl?Include_one_file_in_another

    --
    -bts
    -Motorcycles defy gravity; cars just suck
     
    Beauregard T. Shagnasty, Aug 10, 2007
    #2
    1. Advertising

  3. Matt White

    dorayme Guest

    In article
    <BEPui.27243$>,
    "Beauregard T. Shagnasty" <> wrote:

    > Matt White wrote:
    >
    > > I am creating a page with 2 <div>'s - one is a menu and one holds the
    > > page content. The menu is the same on every page. What is the best
    > > way to get the HTML for the menu on every page without putting the
    > > full source on every page? I'd rather have a separate menu.html file
    > > that gets loaded into the menu <div> when each page loads. Thanks.

    >
    > http://allmyfaqs.net/faq.pl?Include_one_file_in_another


    I sometimes wonder what other folks do in regard to the includes,
    do they put in all the enclosing element markup within the
    include or leave the container explicit in the html file to
    remind the author how the include goes. I tend to go the greedy
    route and put all in the include. This is to show high wire
    courage in the face of a creeping dementia.

    --
    dorayme
     
    dorayme, Aug 10, 2007
    #3
  4. dorayme wrote:

    > "Beauregard T. Shagnasty" wrote:
    >> Matt White wrote:
    >>> I am creating a page with 2 <div>'s - one is a menu and one holds
    >>> the page content. The menu is the same on every page. What is the
    >>> best way to get the HTML for the menu on every page without putting
    >>> the full source on every page? I'd rather have a separate menu.html
    >>> file that gets loaded into the menu <div> when each page loads.
    >>> Thanks.

    >>
    >> http://allmyfaqs.net/faq.pl?Include_one_file_in_another

    >
    > I sometimes wonder what other folks do in regard to the includes, do
    > they put in all the enclosing element markup within the include or
    > leave the container explicit in the html file to remind the author
    > how the include goes. I tend to go the greedy route and put all in
    > the include. This is to show high wire courage in the face of a
    > creeping dementia.


    I place everything in the include file that goes with that object. Can't
    see any reason to have to remember to add containers or whatever to the
    main file. Just add the 'include' line.

    --
    -bts
    -Motorcycles defy gravity; cars just suck
     
    Beauregard T. Shagnasty, Aug 10, 2007
    #4
  5. Matt White

    dorayme Guest

    In article
    <nDRui.27382$>,
    "Beauregard T. Shagnasty" <> wrote:

    > dorayme wrote:
    >
    > > "Beauregard T. Shagnasty" wrote:
    > >> Matt White wrote:
    > >>> I am creating a page with 2 <div>'s - one is a menu and one holds
    > >>> the page content. The menu is the same on every page. What is the
    > >>> best way to get the HTML for the menu on every page without putting
    > >>> the full source on every page? I'd rather have a separate menu.html
    > >>> file that gets loaded into the menu <div> when each page loads.
    > >>> Thanks.
    > >>
    > >> http://allmyfaqs.net/faq.pl?Include_one_file_in_another

    > >
    > > I sometimes wonder what other folks do in regard to the includes, do
    > > they put in all the enclosing element markup within the include or
    > > leave the container explicit in the html file to remind the author
    > > how the include goes. I tend to go the greedy route and put all in
    > > the include. This is to show high wire courage in the face of a
    > > creeping dementia.

    >
    > I place everything in the include file that goes with that object. Can't
    > see any reason to have to remember to add containers or whatever to the
    > main file. Just add the 'include' line.


    In that case I am in good company - never mind that I do it with
    attitude whereas you do it with plain and calm reason. <g>

    --
    dorayme
     
    dorayme, Aug 10, 2007
    #5
  6. Beauregard T. Shagnasty wrote:
    > dorayme wrote:
    >> I sometimes wonder what other folks do in regard to the includes, do
    >> they put in all the enclosing element markup within the include or
    >> leave the container explicit in the html file to remind the author
    >> how the include goes. I tend to go the greedy route and put all in
    >> the include. This is to show high wire courage in the face of a
    >> creeping dementia.

    >
    > I place everything in the include file that goes with that object. Can't
    > see any reason to have to remember to add containers or whatever to the
    > main file. Just add the 'include' line.
    >

    sometimes it's easier to have just the actual content in the included
    file, and to leave all the containers in the main file. If you follow
    the idea of an 'include' you will most probably end up with this
    solution: the container will not change, but the included content might
    change (if you dynamically include files). Therefore you only have to
    define the containers once (in the main file), and the included pages do
    only contain content information. This has another advantage: it's
    easier to edit such a 'container-less' page width a WYSIWIG-editor such
    as dreamweaver and the like in a 'non-cms-environment' where less
    experienced users are uploading only content-pages via FTP...

    but there are many roads to choose :)

    bernhard

    --
    www.daszeichen.ch
    remove nixspam to reply
     
    Bernhard Sturm, Aug 10, 2007
    #6
  7. Matt White

    Neredbojias Guest

    Well bust mah britches and call me cheeky, on Fri, 10 Aug 2007 10:15:50 GMT
    Bernhard Sturm scribed:

    > Beauregard T. Shagnasty wrote:
    >> dorayme wrote:
    >>> I sometimes wonder what other folks do in regard to the includes, do
    >>> they put in all the enclosing element markup within the include or
    >>> leave the container explicit in the html file to remind the author
    >>> how the include goes. I tend to go the greedy route and put all in
    >>> the include. This is to show high wire courage in the face of a
    >>> creeping dementia.

    >>
    >> I place everything in the include file that goes with that object. Can't
    >> see any reason to have to remember to add containers or whatever to the
    >> main file. Just add the 'include' line.
    >>

    > sometimes it's easier to have just the actual content in the included
    > file, and to leave all the containers in the main file. If you follow
    > the idea of an 'include' you will most probably end up with this
    > solution: the container will not change, but the included content might
    > change (if you dynamically include files). Therefore you only have to
    > define the containers once (in the main file), and the included pages do
    > only contain content information. This has another advantage: it's
    > easier to edit such a 'container-less' page width a WYSIWIG-editor such
    > as dreamweaver and the like in a 'non-cms-environment' where less
    > experienced users are uploading only content-pages via FTP...
    >
    > but there are many roads to choose :)


    Ultimately, a container is _always_ left in the receiving file.

    --
    Neredbojias
    Half lies are worth twice as much as whole lies.
     
    Neredbojias, Aug 10, 2007
    #7
  8. Matt White

    dorayme Guest

    In article <f9hds5$tai$>,
    Bernhard Sturm <> wrote:

    > Beauregard T. Shagnasty wrote:
    > > dorayme wrote:
    > >> I sometimes wonder what other folks do in regard to the includes, do
    > >> they put in all the enclosing element markup within the include or
    > >> leave the container explicit in the html file to remind the author
    > >> how the include goes. I tend to go the greedy route and put all in
    > >> the include. This is to show high wire courage in the face of a
    > >> creeping dementia.

    > >
    > > I place everything in the include file that goes with that object. Can't
    > > see any reason to have to remember to add containers or whatever to the
    > > main file. Just add the 'include' line.
    > >

    > sometimes it's easier to have just the actual content in the included
    > file, and to leave all the containers in the main file. If you follow
    > the idea of an 'include' you will most probably end up with this
    > solution: the container will not change, but the included content might
    > change (if you dynamically include files). Therefore you only have to
    > define the containers once (in the main file), and the included pages do
    > only contain content information. This has another advantage: it's
    > easier to edit such a 'container-less' page width a WYSIWIG-editor such
    > as dreamweaver and the like in a 'non-cms-environment' where less
    > experienced users are uploading only content-pages via FTP...
    >
    > but there are many roads to choose :)


    True about the roads and an interesting point about editing. I am
    not quite sure about the point re Dreamweaver though? If one has

    <div id="nav">

    include command

    </div>

    This is a container road, right?

    --
    dorayme
     
    dorayme, Aug 10, 2007
    #8
  9. dorayme wrote:

    >
    > True about the roads and an interesting point about editing. I am
    > not quite sure about the point re Dreamweaver though? If one has
    >
    > <div id="nav">
    >
    > include command
    >
    > </div>
    >
    > This is a container road, right?
    >


    yes. that's the road I usually take :)
    assuming you would have such a construct in the main file:

    <div id="content-container">
    dynamically include content depending on menu context
    </div>

    the include file would then simply look like this:

    <h2>Content only</h2>
    <p>Paragraph with content</p>

    This is much easier to maintain by someone who uses dreamweaver (or a
    very simple WYSIWYG-editor) and who is only editing the content
    includes. He or she will only see pure content markup no (probably)
    confusing div holding it together as all containers are located in a
    single file (the main file) and not distributed in various other content
    files which makes my life as a webdesigner easier :)

    cheers
    bernhard

    --
    www.daszeichen.ch
    remove nixspam to reply
     
    Bernhard Sturm, Aug 11, 2007
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shikari Shambu
    Replies:
    2
    Views:
    6,592
    Mark Fitzpatrick
    Aug 6, 2004
  2. dollar

    web menu in every page

    dollar, May 6, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    368
    Lucas Tam
    May 6, 2005
  3. Steven
    Replies:
    1
    Views:
    350
    Viator
    Mar 7, 2005
  4. Steven LaPha Jr.

    Menu and design elements on every page

    Steven LaPha Jr., Apr 3, 2004, in forum: HTML
    Replies:
    8
    Views:
    548
    Mitja
    Apr 3, 2004
  5. =?Utf-8?B?SXJ3YW5zeWFo?=
    Replies:
    4
    Views:
    2,473
    =?Utf-8?B?SXJ3YW5zeWFo?=
    Oct 30, 2007
Loading...

Share This Page