What's the best way to create a template, where I just have the content in the individual files. The layout needs to be stored in separate file(s), so I can update the design/layout all in one place, and it affects all the pages.
So far I'm just using PHP "include" statements to add in the different parts of the page. Is there a better way (and NOT with a CMS)?
How to Create a Template
Started by Xav, May 16 2008 09:25 AM
16 replies to this topic
|
|
|
#2
Posted 25 May 2008 - 12:29 AM
When you say template, you mean the layout for example where the sidebar should be, where the header should be etc.. or the images?
#3
Guest_Jordan_*
Posted 25 May 2008 - 05:29 AM
Guest_Jordan_*
Before my CMS days I always created a header.php and footer.php. I included these on all pages after that and it was fairly easy to update and maintain. I think a better method is to make a header.php, footer.php and index.php. The index file would have a select/case statement and receive a variable input. Depending on the variable it would automatically load the page the user is requesting. It would also include your header/footer.php file only once.
#5
Posted 25 May 2008 - 10:51 AM
No, if the spider crawls those links and the content is different, there will be more than one 'page'. vB without the SEO mod is just like that.
#7
Posted 25 May 2008 - 11:31 AM
Jordan said:
I think a better method is to make a header.php, footer.php and index.php. The index file would have a select/case statement and receive a variable input. Depending on the variable it would automatically load the page the user is requesting. It would also include your header/footer.php file only once.
Why do you need the header.php and footer.php files? Can't I just have one main file - index.php - and within that I have the entire structure of the page - topbar, sidebar, footer at bottom - and just have a script block in the content section, to load the relevant content page, which contains only the content and no formatting?
#8
Posted 25 May 2008 - 11:52 AM
Xav said:
And with the SEO mod?
It's just more Search engine friendly... nothing less nothing more.
#9
Guest_Kaabi_*
Posted 25 May 2008 - 12:26 PM
Guest_Kaabi_*
Being search engine friendly is important though. For my personal website I've used PHP Include, I didn't think there was another way.
#10
Posted 25 May 2008 - 12:29 PM
Well, for my websites I use TPL.. it's very easy once you get around it.
It's great to have various skins and easily switch/change between one and another.
It's great to have various skins and easily switch/change between one and another.
#11
Guest_Jordan_*
Posted 25 May 2008 - 06:12 PM
Guest_Jordan_*
Xav said:
You mean like www .website.co.uk/index.php?page=home or something? Wouldn't that mean there would only be one page for SEO, or not?
You can use .htaccess and mod_rewrite to make your website SEO. Take a look at what we have done (thanks john!):
http://blog.codecall.net
which really is = http://www.codecall....tion=com_myblog
And google will see the virtual sub-domain and give us higher rank points because of it.
Xav said:
Why do you need the header.php and footer.php files? Can't I just have one main file - index.php - and within that I have the entire structure of the page - topbar, sidebar, footer at bottom - and just have a script block in the content section, to load the relevant content page, which contains only the content and no formatting?
That would work just fine. I like to have separate files for th e header/footer/index files because it is easier to edit IMO.


Sign In
Create Account


Back to top









