TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-06-2009, 12:02 AM   #1 (permalink)
The Contributor
 
Join Date: Jun 2009
Location: Seattle, WA
Posts: 76
Thanks: 1
rguy84 is on a distinguished road
Default Breaking Pages Up

I am playing around with an idea. I have both a breadcrumb and a YUI menu bar on my page. I took from the opening <html> tag to the opening main content tag and threw them all into a file and include that. I gave the text that goes between <title> a variable. So now each page on the back end looks like:
PHP Code:
<?php
  $page_title 
'xxx';
  
$bread 'YYY'// I give my pages {sitename} :: {article title}
  
include_once('header.php');
?>
  {content}
<?php 
  
include_once('footer.php');
?>
This makes things so much cleaner and faster. However now the source layout looks crappy. Has anybody done this? Thoughts?
__________________
Ryan | Blog | Twitter
Send a message via AIM to rguy84 Send a message via MSN to rguy84 Send a message via Yahoo to rguy84 Send a message via Skype™ to rguy84
rguy84 is offline  
Reply With Quote
Old 07-06-2009, 12:50 AM   #2 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

I did it with the meta tags on my personal site, it works. It's neither really good or really bad.
__________________
My Site
adamdecaf is offline  
Reply With Quote
Old 07-06-2009, 07:49 AM   #3 (permalink)
The Contributor
 
Join Date: Jun 2009
Location: Seattle, WA
Posts: 76
Thanks: 1
rguy84 is on a distinguished road
Default

I am not sure what you mean. If you took that chunk of code, wrote a paragraph in place of {content} and saved it as something.php, the page would fully work...
__________________
Ryan | Blog | Twitter
Send a message via AIM to rguy84 Send a message via MSN to rguy84 Send a message via Yahoo to rguy84 Send a message via Skype™ to rguy84
rguy84 is offline  
Reply With Quote
Old 07-06-2009, 06:46 PM   #4 (permalink)
The Wanderer
 
ScottRiley's Avatar
 
Join Date: Jun 2009
Location: Liverpool, UK
Posts: 7
Thanks: 1
ScottRiley is on a distinguished road
Default

If I understand what you're talking about correctly, I do it all the time, separate PHP files for; top navigation, any sidebars that appear on multiple pages, the footer and the breadcrumb if I'm using one.

I code the general layout I want of the site using CSS-styled DIVs and then include all the pages with PHP.

Just so much better, if your nav changes, you change one file, if your footer changes, you change one file, if a site contains 2 or more pages that share common elements then I believe that these common elements should be put in their own file, it just makes everything so much easier.

What problems are you having with the source layout?
Send a message via ICQ to ScottRiley Send a message via AIM to ScottRiley Send a message via MSN to ScottRiley
ScottRiley is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB 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
Duble the work on pages Face_Of_Boe Absolute Beginners 3 01-06-2009 04:16 PM
Arrays + Pages blayne4k Script Giveaway 0 04-20-2008 10:35 PM
Secure pages?? marxx General 6 03-09-2008 08:49 AM
Display pages php code? Aaron General 16 01-31-2008 11:29 AM
Breaking up an article into pages danielneri General 5 01-04-2008 08:02 PM


All times are GMT. The time now is 12:55 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design