TECH Is it possible to make a webpage like this?

Falconer

Well-Known Member
Jun 23, 2006
65,534
Ok here's a rough illustration that hopefully explains what I'm looking to do.

Can you have separate .html(?) files that load in separate places on your page? So say you have the header, which contains a logo, some links, info, etc. and you want that to load on every page on your site, so you just make it its own thing that loads separately.

Then you've got the unique content per page, which will obviously differ per page, so that becomes like a regular page.

Then on the side you've got panels for navigation, or ads, or bio info, or whatever, and you want those to be *updateable* across all pages at once. So you want them to be their own objects that load on each page, so when it comes time to update it, you just update one file and then the changes are loaded globally on all your pages, rather than having it have to be changed manually on each page, which could get tedious if you have 100s of pages on your site. Kind of like how if you change the source of an image, it changes across your website everywhere it is loaded; I want html on parts of my page to be able to be changed globally like that.

So is this possible, and how?

sectional.gif
 
TS
TS
Falconer

Falconer

Well-Known Member
Jun 23, 2006
65,534
tell me more. I was reading somewhere else that iframes aren't good to use cuz google bots miss them or something
 

Ricky

█▄ █▄█ █▄ ▀█▄
Jun 17, 2005
38,834
i'd use an object tag or server side include
 
TS
TS
Falconer

Falconer

Well-Known Member
Jun 23, 2006
65,534
so as a complete noob where would I go to learn how to do that with php?
 

Ricky

█▄ █▄█ █▄ ▀█▄
Jun 17, 2005
38,834
Hmm.

Is it possible to see the code of a website that's set up that way or would the code be hidden on the server side?

hidden server side

itll be something like

<?php
include 'whatever.html';
?>
 
TS
TS
Falconer

Falconer

Well-Known Member
Jun 23, 2006
65,534
So is each sectional .html file placed in a table cell, or a CSS division? How do they do it?
 

Major Tom

Active Member
Mar 10, 2003
5,675
England
There are loads of ways to do it - iframes is probably the easiest if you're a noob, but not the best.

SSI is very easy too, if you don't fancy php.
 
TS
TS
Falconer

Falconer

Well-Known Member
Jun 23, 2006
65,534
what is ssi? I've never heard of that. Is it pretty easy?

I was all set to do my site in normal html until I realized that with many pages it would take FOREVER to manually update the same menu in each one, so I figured there has to be some way to do it globally that even a noob like me can understand.
 

kilamasta

New Member
Aug 14, 2006
108
Yes you do that with PHP. I have a template for all my website. I have setup an example for you here : http://alacor.awardspace.com/

The page contains nothing but if you click on the menu, you will see that the basic frame of the page always stays the same, and most of my pages contains only few lines of codes.

If you look at the title of each page, you will see "SITE TITLE - XXXXXXXX". If i want to change "SITE TITLE" in everypage, i just have to change "header.php" once. ( The xxxxxx is customed for each page)

<?php
include("functions.php");
WriteStartPage("Home");
?>

<div class="header">
<?php
include("header.php");
?>
/*********This is where the body of text starts*************/
</div>

<h1>Title</h1>
<p>
text
</p>



/* this is where the body ends*/
<div >
<?php include("footer.php");?>

</div>

<?php WriteEndPage();?>
 

kilamasta

New Member
Aug 14, 2006
108
Actually the following example might be better for your needs:

http://alacor.awardspace.com/sidemenu/index.php

If you don't want to learn php ( you should), you could do massive search & replace in all of your html files all at the same time.

Search :"a href="image/HEADER.JPG"
Replace "a href="image/NEW_HEADER.JPG"

Although in that example you could just change header.jpg altogether :mamoru:
 
TS
TS
Falconer

Falconer

Well-Known Member
Jun 23, 2006
65,534
Actually the following example might be better for your needs:

http://alacor.awardspace.com/sidemenu/index.php

If you don't want to learn php ( you should), you could do massive search & replace in all of your html files all at the same time.

Search :"a href="image/HEADER.JPG"
Replace "a href="image/NEW_HEADER.JPG"

Although in that example you could just change header.jpg altogether :mamoru:

Ok in that example, say I want to have that second area (where you have " Text sans but précis~~~~~~~~~~~~~~~~~~pour l'instant" written) on every page, but then at some point in the future I want to change that section on every page just by updating one file. How do I do that?
 

kilamasta

New Member
Aug 14, 2006
108
Ok in that example, say I want to have that second area (where you have " Text sans but précis~~~~~~~~~~~~~~~~~~pour l'instant" written) on every page, but then at some point in the future I want to change that section on every page just by updating one file. How do I do that?
Well in my case, that section is one file called "footer.php". I would just change that single file and every page would get the change. I am gonna do it right now ^^

These are the source files I used for that site (open in any text editing software)
http://www.upload.ws/download-6329491.html

Most of the content in the source file is french, but you should not have any problem figuring it out.
 
Last edited:
TS
TS
Falconer

Falconer

Well-Known Member
Jun 23, 2006
65,534
Well in my case, that section is one file called "footer.php". I would just change that single file and every page would get the change. I am gonna do it right now ^^

These are the source files I used for that site (open in any text editing software)
http://www.upload.ws/download-6329491.html

Most of the content in the source file is french, but you should not have any problem figuring it out.

Ok I'm getting confused now cuz when I view the source for that page I see this:

Code:
<p class="center">
Here is my new footer. I will be changed in all file.
Copyright Me, stupid plagiarism
</p>
So it looks to me like that text is hardcoded into the page and not being referenced in another file.

What am i missing?
 

kilamasta

New Member
Aug 14, 2006
108
This because this is PHP : the command I give the server is

"Take header.php,
append (whatever page, index,product, shopping cart, etc)
append footer.php
and generate a one time only HTML for the user"

<div class="header">
<?php include("header.php");?>
/*********TAKE HEADER.PHP****************/
</div>
/*******************APPEND WHATEVER PAGE HERE*************/*
<h1>Title</h1>
<p>
whatever page
</p>



/***************** APPEND FOOTER.PHP HERE***********************/
<div >
<?php include("footer.php");?>

</div>
Header.php
<img src="header.png" alt="Ici on met le header lol"></img>

<div class="time_box">
[....]
Index.php
<h1>Titre principale</h1>
<p> texte d'introduction au programme texte d'introduction au programme 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
texte d'introduction au programme texte d'introduction au programme texte d'introduction au programme
texte d'introduction au programmetexte d'introduction au programmetexte d'introduction au programme
d'introduction au programme

</p>

<h2> Parti 1</h2>
<p> ballbla bla bla blal product</p>
Footer.php
<div class='foot'>
<br/>
<p class="center">
Here is my new footer. I will be changed in all file.
Copyright Me, stupid plagiarism
</p>

<p>

<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>


<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://alacor.awardspace.com/css.css">
<img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"/>
</a>
</p>
</div>
 
Last edited:
TS
TS
Falconer

Falconer

Well-Known Member
Jun 23, 2006
65,534
Ohh!! So what I was expecting to see is actually happening behind the scenes, and it's putting the actual output directly into the html.

Got it. Thanks.

I will have to play around with this now.

Thanks :bowdown:
 

Users who are viewing this thread

About Us

  • Please do not post anything that violates any Local, State, Federal or International Laws. Your privacy is protected. You have the right to be forgotten. Site funded by advertising, link monetization and member support.
OT v15.8.1 Copyright © 2000-2022 Offtopic.com
Served by fu.offtopic.com

Online statistics

Members online
325
Guests online
35
Total visitors
360

Forum statistics

Threads
369,400
Messages
16,880,966
Members
86,872
Latest member
btcdiana