Forum Moderators: coopster
Right now you call up a page, like index.php, this file then calls temp.php, which holds all the major HTML structure, that file calls on side.php, which holds the side links and navigation... Only problem is that if I have an apostrophe that is not... "crossed out?" then the system will give a parse error...
I need a new system badly... My friend had one where you call up a .txt file or some such nonsense... He says most websites use this template structure.. anyone know of anything better?
I am looking for osmething where I can call up a file easily and quickly without having to worry about apostrophes, plus I give my framework out to other people to use, and I hate having to say "that is the php don't mess with that". I would rather it call a file, and that's it, no more nonsense.
I can give you what I currently have if you would like, it's pretty basic if you ask me... anyone got anything better?
(P.S. I'm really new to php, so... explain slowly)
Rather than explain what you have, explain more clearly what you want.
You want to have various pages that uses the same side links (stored in one file), and then content for each page stored in another file, and the structure of the whole page (I guess placing the content and the side links) in a 'main' file.
Is that right?
This is what I want...
I want one page that has most, if not all the HTML coding inside it... I then want a page (maybe 2) of links and navigation, as well as the content you called...
I have seen it in action, any large website uses a template system... or whatever you want to call it. If you update your website you only have to update ONE page, that's the beauty of it... Only problem is how mine is setup...
I want it to use .txt files or something other then echo'ing a page and php include... I want it more stable, so that if I put down "don't" i won't have to have "don\'t" so a parse error doesn't show up... Just a nice and easy system for one page of HTML, pages of content that call that, and the HTML can call up the navigation system (which makes editting easier). Just not under my current system.
It depends on how different you want your layout to be. Is it a totally different layout or is it just a reskinning? For reskinning (colour changes) I have used a couple things. It depends on the criteria for the colour changes. I sometimes use a control file which loads different colours into variables by section, or whatever the criteria is, then the template uses vars for all colours in it. CSS files can be parsed for php as well and the logic could be done there.
As far as totally different layouts go, you would probably have to include a control file to switch the templates. This could get a little messier and slower but depending on your criteria for the changes you may be able to simplify it. If you wanted different l;ayouts for different sections you could make those sections each in their own directory and put the template for it in the section root and include that.
The key is to make it fast and logical, lots of templating systems are slow and cumbersome.
So I have content, navigation, and the full backbone... But the way it is coded, is horrible... Having to "escape" an apostrophe gets really annoying fast... Also if I want multiple tables I can approach it so many ways but only know the noob way with alot of coding.
What I am looking for and somewhat found, is a div layout that has a footer, right mid left and a footer. It allows the main content to expand out according to your window space, plus it seems to be structured very nicely..
I added the side tables, mid table and right hand tables but it becomes congested really fast, and breaking it up would be difficult. Too much coding on to many pages. I may have to draw a diagram or something...
you shouldn't need to escape quotes in a template, that sounds a little nuts.
have you looked at this thread? it might help a little, might not too.
[webmasterworld.com...]
include $content;
in the middle. Then you just do this on every page.
$content = "pathtocontentpage.html";
include "template.php"; "---
That was your own post, but i'm confused. That is pretty much waht I have, the entire shell is in my template.php, no biggie, not much of a change. The great change I need is the:
$content = "pathtocontentpage.html";:
but wouldn't that just mean that if I call index.php and it says that, then i'd have to have ANOTHER page called like index_content.php to have it link back to it?
Also if I do have that, couldn't I have it point to like... html_page.txt, would it parse the html coding?
I HATE it because someone who doesn't know HTML / Php and has to be taught (i give access to a sub-domain via partnerships), and they don't understand why they have to put:
don\'t
and not:
don't
Plus they see the top of the page saying title="", and all this stuff and just go "AAHH!" but this whole thing if "content="htmlfile.html" is great, but I dunno if that makes double the files!
I HATE it because someone who doesn't know HTML / Php and has to be taught (i give access to a sub-domain via partnerships), and they don't understand why they have to put:don\'t
and not:
don't
I am a little confused. If the people you are giving subdomains to don't know html or php, what exactly are they doing? Are they just writing text files?
If their not using html then why not just use htmlentities() or something similiar to change the quotes?
So... how does this <<<EOF work anyhow? I know the basic PhP premise I guess, but i've only dipped my finger into the pool of coding.
I've been doing this for 2-3 years and I learn at my own pace (slow), but when you look at your site you know you made it, and no matter if someone says "your site sucks" you know you can do better then them because they don't program lol.
An easy, simply, no problem included CMS. Yup, that's not too difficult. people will go the .txt file way with that, or you can go the Database way, db way wouldn't be too difficult, you simply create the html file in your server and store the content in a db with the file name, like "home.html" then when you create the html page you see something like:
<html
<?php
$page = "home.html";
[query your db for the "home.html" record and its body]
$Data = mysql_fetchrow($blah);
$pagename = $data[0];
$content = $data[1];
echo $content;
?>
</html>
BAM, you got what you're looking for, sweet, simple and easy to do...