Jump to content
xisto Community
Sign in to follow this  
Cerb

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

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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

/*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://forums.xisto.com/no_longer_exists/

For multiple content values add a '&' after every value:
http://forums.xisto.com/no_longer_exists/

Hope this helped...

Notice from Johnny:
Fixed the code tags.

Edited by Johnny (see edit history)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 :P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.