Forum Moderators: phranque

Message Too Old, No Replies

Include in a Header

         

horseatingweeds

2:49 pm on May 28, 2007 (gmt 0)

10+ Year Member




System: The following 2 messages were cut out of thread at: http://www.webmasterworld.com/webmaster/3346944.htm [webmasterworld.com] by physics - 9:43 am on May 28, 2007 (MST -7)


Can you and is it a good idea to use an include in the header, like for links to js and css files?

thecoalman

4:04 pm on May 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can use any HTML you want in an include.

rocknbil

5:40 pm on May 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The question is, why would you want to? CSS and JS already have mechanisms to "include" a common file without parsing and SSI, ASP, or PHP:

<link rel="stylesheet" type="text/css" href="your.css">
<script type="text/javascript" src="your.js"></script>

warth0g

5:48 pm on May 28, 2007 (gmt 0)

10+ Year Member



I started using header includes in 1997 - its the only way to go regardless of what language you use. In 97 I was using SSI .shtml to create straign HTML headers.

I migrated to PERL and also used them in PHP, ASP and now I almost exclusively use Adobe ColdFusion because it is hands down the fastest development environment in existence (many will argue but I have been programming for 13 years and I just plain am smarter than those people)

Now if you look at any page there are 3 tags - sometimes the middle tag is replaced by actual content but essentially it is:

<cfinclude templatee="header.cfm">

<cfinclude template="cms.cfm">

<cfinclude templatee="footer.cfm">

I put everything in the header, body tag, meta tags, styles, scripts, menus etc. if i want different meta tags for each page i just use a database.

horseatingweeds

8:09 pm on May 28, 2007 (gmt 0)

10+ Year Member



The question is, why would you want to?

So I can include several of these links and switch them.

Thanks warth0g
I haven't started learning data base stuff yet. I plan to start at the end of this week when my book comes in.