Include database template in UDT?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
mr_compsci
New Member
New Member
Posts: 5
Joined: Thu Oct 23, 2008 1:47 pm

Include database template in UDT?

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Include database template in UDT?

Post 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...
mr_compsci
New Member
New Member
Posts: 5
Joined: Thu Oct 23, 2008 1:47 pm

Re: Include database template in UDT?

Post 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.
Post Reply

Return to “Modules/Add-Ons”