Jul 5, 2008

1 Page Containing Layout. Others Containing Text - Is there a way to do this?

Free Web Hosting, No Ads > CONTRIBUTE > The Internet > Website Discussion

free web hosting

1 Page Containing Layout. Others Containing Text - Is there a way to do this?

Cerb
Even with PHP includes for menus and such, changing the layout of a site can be a big deal. Is there a way to have 1 page for the layout and multiple pages for the contents? The site in question can be seen here. All of the text inside the larger cell would be the contents.

That way I would just have to update the single page for layout, and it would be included into each of the separate content pages.

Does this make any sense to anyone else, or am I not explaining what I mean well enough?

Reply

truefusion
I think i know what you're talking about. If not then i'll try anyways. I'ma suggest using the get method.

CODE
/*
put this where you want the content from another page to show
*/
<?php include(&page.html); ?>
/*
if you want php pages to show just change $page.html to $page.php
*/


And in the uri you'd define $page by http://example.org/index.php?page=name_of_document

For multiple content values add a '&' after every value:
http://example.org/index.php?page=name&page2=name2

Hope this helped...

Notice from Johnny:
Fixed the code tags.

 

 

 


Reply

Cerb
Awesome! That's exactly what I was looking for. The only problem is finding a way to make the index page the same. I tried redirecting cerb.trap17.com to cerb.trap17.com/index.php?page=home.html, but for some reason the redirector didn't recognize question marks. Check out cerb.trap17.com if you don't get what I mean.

Reply

truefusion
Sorry, i dont understand what you mean, but your site seems to be running smoothly, so i'm guessing everything is ok now?

As for the contact page, i suggest not posting your email address like that, since there are web bots that surf the web for stuff like that. Thus bringing in spam.

I'd suggest making a php mail form with an anti-spam feature.

Reply

green fairy
Another option you may want to consider, is to use iframes. At DynamicDrive you can get a free script that creates an iframe that will resize with the content. You can specify the width of the iframe, and then the height adjusts to the length of the content that will be showed inside the frame, which means no iframe scrollbar. This works really well because you can't even see there's an iframe, and your layout won't have to reload every time you enter a new link. In that way, you only need one page for the layout, just like you wanted. You can keep the content separate from the layout. To simplify it even more, you could use one separate css file for your site's design and colour information. You can just link to your css file on each page of your site. It can be done like this in case you didn't know:
<link rel="Stylesheet" type="text/css" href="yourcssfile.css">
Hope this helps. Using this solution, it will always be an easy fix changing the design and layout of your entire site biggrin.gif

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:


Searching Video's for 1, page, layout, text
advertisement



1 Page Containing Layout. Others Containing Text - Is there a way to do this?



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE