Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Same Menu On Every Page

Reply
Thread Tools

Same Menu On Every Page

 
 
Matt White
Guest
Posts: n/a
 
      08-10-2007
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.

 
Reply With Quote
 
 
 
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      08-10-2007
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
 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      08-10-2007
In article
<BEPui.27243$(E-Mail Removed)>,
"Beauregard T. Shagnasty" <(E-Mail Removed)> 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
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      08-10-2007
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
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      08-10-2007
In article
<nDRui.27382$(E-Mail Removed)>,
"Beauregard T. Shagnasty" <(E-Mail Removed)> 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
 
Reply With Quote
 
Bernhard Sturm
Guest
Posts: n/a
 
      08-10-2007
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
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      08-10-2007
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.
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      08-10-2007
In article <f9hds5$tai$(E-Mail Removed)>,
Bernhard Sturm <(E-Mail Removed)> 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
 
Reply With Quote
 
Bernhard Sturm
Guest
Posts: n/a
 
      08-11-2007
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Explorer.exe error report every time access every type of video me =?Utf-8?B?SXJ3YW5zeWFo?= ASP .Net 4 10-30-2007 07:49 AM
web menu in every page dollar ASP .Net 1 05-06-2005 07:24 AM
Same variable on every JSP page Steven Java 1 03-07-2005 06:04 PM
Putting same Javascript function in every ASP.net page Shikari Shambu ASP .Net 2 08-06-2004 10:55 PM
Menu and design elements on every page Steven LaPha Jr. HTML 8 04-03-2004 05:10 PM



Advertisments