The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> the same (HTML) code in every pages
The_Game
post Oct 6 2008, 11:34 AM
Post #1





Group: Members
Posts: 3
Joined: 6-October 08
Member No.: 6,824



Hi to everibody biggrin.gif,

I'm a noob and i'm writing my first web site...

I wonder if one can write only one time some lines of html code that will be needed in more than one page.

Can something like this (see code below) or similar be done with html code instead of js?:


CODE


<head>
...
   <link rel="stylesheet" href="css/main.css" />
   <script type="text/javascript" src="js/settings.js"></script>
   <script type="text/javascript" src="js/arrays.js"></script>
   <script type="text/javascript" src="js/engine.js"></script>
</head>

.
.
.
<body>
...
<script type="text/javascript">
//new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, borderwidth, delay, pause (0=no, 1=yes), optionalRandomOrder)
new fadeshow(fadeimages, 1007, 230, 0, 6000, 1, "R")
</script>
...
</body>




Just for information: I want to write only in one place the menu (list structure) that is the same in all pages.


Thanks.


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 6 2008, 11:59 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



No, not with HTML but with SSI (Server Side Includes). PHP and other real programming languages can also do it. HTML can't *do* anything like that since it's a mere markuplanguage.

http://htmlhelp.com/faq/html/design.html#include-file
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
The_Game
post Oct 7 2008, 09:20 AM
Post #3





Group: Members
Posts: 3
Joined: 6-October 08
Member No.: 6,824



Thanks pandy,

For the answer and the link.

I already had tryed to find something about and run into SSI (Server Side Includes) and 'object' element but I was confused.

I think at this point SSI and Preprocessors are not for my skills. Will keep the menu structure in every page. blush.gif

Great help, biggrin.gif
Thanks for your time.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 7 2008, 05:02 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



You make a mistake. SSI (for this purpose) is very easy. Basically you cut out the code you want to include, place it in a separate document and put a "spacial tag" in its place in the main document. Does that sound so hard? smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
The_Game
post Oct 8 2008, 06:18 AM
Post #5





Group: Members
Posts: 3
Joined: 6-October 08
Member No.: 6,824



Ok pandy, I will have a look at SSI and give it a try.
Thanks for the motivation (that's the Way). biggrin.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 8 2008, 01:18 PM
Post #6


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Ask if you get stuck. happy.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd April 2024 - 12:00 PM