Originally Posted by t3hl33td4rg0n
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.
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.
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.
So I am assuming you are including the dynamic data "in-between" those files? Like....
$headerFile = file_get_contents('./tpl/head.html');
do some stuff;
$mainTpl = file_get_contents('./tpl/main.html');
do some stuff;
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.