These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:20 pm Advanced search

HTML5, possibly library?

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

HTML5, possibly library?

Postby geto » Tue Mar 01, 2011 3:22 pm

Greetings.

I have a small web site. I will have several pages and want to know if there is a way to link in format/layout information in all pages that will stay the same. Like side menus, top menus, stuff that will not change once it's concrete.

Otherwise it's a lot of cutting and pasting into each file.

Just wondering if there is something like this. I searched and found it could be libraries, but found a lot of information not relating to what I was looking for.

Thank you
Justin
geto
<h6>
 
Posts: 2
Joined: Tue Mar 01, 2011 3:18 pm

Postby JAB Creations » Tue Mar 01, 2011 5:33 pm

I think what you're talking about are template files. Like how you can include the same style sheet with a link element to use the same styling you want to use the same sidebar (X)HTML on all/most/certain pages, if I am correct.

There are a few ways to do this. I use PHP and the code is rather simple...

index.php
Code: Select all
<?php
include('sidebar.php');
include('menu.php');
?>



sidebar.php
Code: Select all
<div id="side">
<p>side bar here</p>
</div>
<?php
// random PHP code intermixed if neccesary
?>


There is also SSI, Server Side Includes which uses Apache I think.

If you're using a Microsoft server the code would look something like this...

Code: Select all
<!--#include virtual="header.html"-->
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA

Postby geto » Wed Mar 02, 2011 1:41 am

That looks like what I'm talking about. Thank you. It points me in the right direction so I can do some more research.

Thank you.

JAB Creations wrote:I think what you're talking about are template files. Like how you can include the same style sheet with a link element to use the same styling you want to use the same sidebar (X)HTML on all/most/certain pages, if I am correct.

There are a few ways to do this. I use PHP and the code is rather simple...

index.php
Code: Select all
<?php
include('sidebar.php');
include('menu.php');
?>



sidebar.php
Code: Select all
<div id="side">
<p>side bar here</p>
</div>
<?php
// random PHP code intermixed if neccesary
?>


There is also SSI, Server Side Includes which uses Apache I think.

If you're using a Microsoft server the code would look something like this...

Code: Select all
<!--#include virtual="header.html"-->
geto
<h6>
 
Posts: 2
Joined: Tue Mar 01, 2011 3:18 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests