Page 1 of 1

Include database template in UDT?

Posted: Thu Oct 23, 2008 1:52 pm
by mr_compsci
Is it possible to include a database template in a user defined tag?  I am currently storing my templates in tmp/templates/ and using code like this:

Code: Select all

global $gCms;
$smarty->assign("a_variable", "value");
$template="my_template.tpl";
$smarty->display($template);
I'd love to be able to use one of the templates that I can manage from the admin interface, though, so I don't have to edit the templates on disk.  Is this possible?

Thanks,
Ron

Re: Include database template in UDT?

Posted: Fri Oct 24, 2008 6:30 am
by Dr.CSS
Templates for what?...

Why are you storing them in the temporary directory, you do realize that at some point you are going to want to clear out your site cache and anything in that folder will by deleted, at the ver least it will all be removed when you do an update...

Re: Include database template in UDT?

Posted: Fri Oct 24, 2008 3:15 pm
by mr_compsci
Templates for what?...
I'd like my tag to be able to use smarty templates. In some cases I am copying small existing apps from our old site, and they rely on smarty templates for their output.  It'd be easier for me to manage them if they were stored in the database so I could edit them from the CMSMS admin interface.
Why are you storing them in the temporary directory
I can't remember where I saw that, but either a forum post illustrated this or an existing plugin does it.   I suppose if I can't put them in the database, then I should choose a different template folder.