Xhtml Layout

This is a discussion on "Xhtml Layout" within the Starting Out section. This forum, and the thread "Xhtml Layout are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Starting Out

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 21st, 2007, 17:58
Junior Member
Join Date: Sep 2007
Location: Uk
Age: 21
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Xhtml Layout

This may seem like a silly post, but I have something to ask about basic layout principles.

If I had a xhtml + css based website with alot of pages, but wanted to change the layout (i.e. the colours and graphics etc) is there a quick way to move over all the content of the pages without having to copy and paste the content into each pages html?

I hope that makes sense :/

Thanks!
Reply With Quote

  #2 (permalink)  
Old Sep 21st, 2007, 18:02
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Xhtml Layout

Yes ... you need to use includes

see the article - Using includes to add common elements to your sites.

Last edited by karinne; Sep 21st, 2007 at 18:12.
Reply With Quote
  #3 (permalink)  
Old Sep 21st, 2007, 18:07
Junior Member
Join Date: Sep 2007
Location: Uk
Age: 21
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Xhtml Layout

Thanks for your reply.

I see. So will I be needing to convert my site from html to php then?

Reply With Quote
  #4 (permalink)  
Old Sep 21st, 2007, 18:13
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Xhtml Layout

yes or .shtml if you decide to you SSI ... but I would suggest PHP include().
Reply With Quote
  #5 (permalink)  
Old Sep 21st, 2007, 18:15
Junior Member
Join Date: Sep 2007
Location: Uk
Age: 21
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Xhtml Layout

Ok, thankyou.

Don't suppose you can throw me towards a post about how to convert to PHP could you?
Reply With Quote
  #6 (permalink)  
Old Sep 21st, 2007, 18:18
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,662
Thanks: 0
Thanked 9 Times in 9 Posts
Re: Xhtml Layout

There is a short post here.. Basiclly put your div in a file then link to it. This may help: http://www.webtutorialz.com/28/.
Reply With Quote
  #7 (permalink)  
Old Sep 21st, 2007, 18:19
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Xhtml Layout

I'm pretty sure I explain in the article.

it's just changing your extension really because you will be adding the php include funtion

HTML: Select all
<html>
    <? include('header.html'); ?>
....
The files you are include (like in the example above - header) ca have html extension unless you have php code in there.
Reply With Quote
  #8 (permalink)  
Old Sep 21st, 2007, 18:20
Junior Member
Join Date: Sep 2007
Location: Uk
Age: 21
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Xhtml Layout

Thanks Marc, i'll go take a look now.
Reply With Quote
  #9 (permalink)  
Old Sep 21st, 2007, 18:20
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Xhtml Layout

Quote:
Originally Posted by Marc View Post
There is a short post here.. Basiclly put your div in a file then link to it. This may help: http://www.webtutorialz.com/28/.
I think the code that's posted in there might confuse people.

The article I wrote is simpler I think

Seriously tho ... don't know how simpler this can be

Using PHP to include files

Syntax

PHP: Select all

<? include('/directory/file.php'); ?>

How to use

Here's your index.php file (note that all your files using the php include() function must have the .php extension) ...
HTML: Select all
<body>
    <? include('navigation.inc'); ?>
    <div id="content">....</div>
</body>
And this would be your navigation.inc file (note that your included file can have the extension you want - .html, .php, .inc, .whatever)

HTML: Select all
<ul>
    <li><a href="home.php">Home</a></li>
    <li><a href="services.php">Services</a></li>
    <li><a href="contact.php">Contact</a></li>
</ul>

Last edited by karinne; Sep 21st, 2007 at 18:23.
Reply With Quote
  #10 (permalink)  
Old Sep 21st, 2007, 18:24
Junior Member
Join Date: Sep 2007
Location: Uk
Age: 21
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Xhtml Layout

Thanks, thats all great, just I don't have a index.php, i have an index.html...
I get the idea of what an include is and it definatly is just what I need, what i'm struggling with now is just how to get started. At the moment all I have is a load of .html pages. I have never even attempted to use php, so don't have a clue where to start!
Reply With Quote
  #11 (permalink)  
Old Sep 21st, 2007, 18:28
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Xhtml Layout

just change their extensions to .php ... that's it!
Reply With Quote
  #12 (permalink)  
Old Sep 21st, 2007, 18:31
Junior Member
Join Date: Sep 2007
Location: Uk
Age: 21
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Xhtml Layout

wow! its that easy :O can't believe it!

Thankyou very much!
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 On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fluid layout - IE6 clichés the layout when resizing cyberseed Web Page Design 7 Jun 16th, 2007 05:14
xhtml 1.0 ivyholly Web Page Design 2 Sep 28th, 2005 14:36
What makes a layout a good layout? Miles Lombardi Graphics and 3D 4 Jul 26th, 2005 03:22


All times are GMT. The time now is 16:50.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43