Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> 1 Page Containing Layout. Others Containing Text, Is there a way to do this?
Cerb
post Jul 13 2005, 09:16 PM
Post #1


Super Member
*********

Group: Members
Posts: 240
Joined: 9-July 05
Member No.: 9,213



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?
Go to the top of the page
 
+Quote Post
truefusion
post Jul 14 2005, 12:45 AM
Post #2


Ephesians 6:10-17
Group Icon

Group: [MODERATOR]
Posts: 1,917
Joined: 22-June 05
From: The World of Gentoo
Member No.: 8,528



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.


This post has been edited by Johnny: Jul 14 2005, 12:50 AM
Go to the top of the page
 
+Quote Post
Cerb
post Jul 14 2005, 05:53 AM
Post #3


Super Member
*********

Group: Members
Posts: 240
Joined: 9-July 05
Member No.: 9,213



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.
Go to the top of the page
 
+Quote Post
truefusion
post Jul 14 2005, 10:18 PM
Post #4


Ephesians 6:10-17
Group Icon

Group: [MODERATOR]
Posts: 1,917
Joined: 22-June 05
From: The World of Gentoo
Member No.: 8,528



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.
Go to the top of the page
 
+Quote Post
green fairy
post Jul 15 2005, 04:24 PM
Post #5


Newbie [Level 3]
***

Group: Members
Posts: 45
Joined: 18-June 05
From: Norway
Member No.: 8,410



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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Php Unique Hit Counter(29)
  2. Button To Print Current Web Page(14)
  3. Word Wrap Text In Div.(16)
  4. Problem With Page Redirect(8)
  5. Layout Size(10)
  6. Help In Ipb 2.1.6 Portal Page(2)
  7. Adding Shine To Text(4)
  8. What Program Do You Use To Design Your Web?(95)
  9. Web Page Layouts(6)
  10. Text Based Game(6)
  11. How To Make An Item Scroll With You On The Page.(10)
  12. PHP Function To Add Previous and Next Page Feature(5)
  13. Web Page Designing(5)
  14. An Ode To Gmail.(5)
  15. Php Linking(2)
  1. Text Visualizer(1)
  2. Ad Text(2)
  3. Text Size In "fill-in" Form Blanks(2)
  4. Page Load Error When Trying To Get Into Control Panel(2)
  5. Plot Page Help Invisionfree(0)
  6. My Ro Page(4)
  7. Best Text-based (mmo)rpg's(6)
  8. Cant Log Into Cpanel [resolved](11)
  9. I Can't Find The Password Reset Page... [resolved](5)
  10. Need Help With Flex Rich Text Editor Please!(0)
  11. Trap17 Flex Layout(0)
  12. Trap17 Registration Page Linkage Errors(2)
  13. My First Website(1)


 



- Lo-Fi Version Time is now: 11th October 2008 - 12:16 AM