View Single Post
Old 03-23-10, 03:08 AM   #4
ViN86
 
Join Date: Mar 2004
Posts: 15,486
Default Re: LAMP Templating/CMS Performance

Quote:
Originally Posted by t3hl33td4rg0n View Post
Yeah, I've considered that, and I am still considering the option. I may go both ways where the template could either grab the main dynamic data via php echo statements or retrieved using AJAX. I must still keep the mindset that I have to keep template interaction as easy as possible without sacrificing performance and feature-set.

Unfortunately, completely relying on AJAX to get data has its own issues (at least it used to). I would love to create a robust application in javascript that could allow one to freeform design a site and still harness the power of dynamic applications.

I may even integrate Dreamweaver support in some fashion by way of extensions, where a user could create custom queries using a GUI and have the usability of Dreamweavers WYSIWYG. Yes, it will rock!
Yea there are some limitations to AJAX. Mostly that older browsers don't really support it and different browsers handle things differently.

Quote:
The main reason is that anyone with HTML knowledge could create their own template/theme. just place special tags where you want the stuff to go and you're good. It was an ease-of-use feature. But that guy gave me an idea about how I could implement the other method. I never really thought about the other method (2) until i had the discussion over at devshed, thats why I wanted to have the trials and see how it stacked up.
Yea, I learned method 2 from a PHP book. Once I realized that you can pretty much insert PHP tags and write some code wherever you want, it only seemed natural to just insert data on the fly wherever instead of searching for strings to replace.

Quote:
So I am assuming you are including the dynamic data "in-between" those files? Like....

PHP Code:
$headerFile = file_get_contents('./tpl/head.html');
do
some stuff;
echo
$headerFile;
$mainTpl = file_get_contents('./tpl/main.html');
do
some stuff;
echo
$mainTpl;
Actually it's even simpler than that. I just write w/e PHP and HTML I need into a page called header.php or something, then I just put in include("header.php"); where I want the header to display and it just echoes the text. You have to be careful, though. I typically store my files in a template folder. But when you use include, it treats the inserted code as if it were coming from the home directory, not where it actually is. So if you're not careful you can mess up links this way.

Quote:
Thanks!
NP
ViN86 is offline   Reply With Quote