Hello,
I am writing my own module. It's almost finished.
But know i want to add a tab so users can edit the template or add a template of there own. I tried, but i faild. Can someone help explain how i can get a template in to the database?
I think i know how i can get the template to show in the textarea in the admin panel and then to save the template after editting. Because i think that's nothing more then making a form.
But i am having trouble getting the template in to the database when the module gets installed.
I hope someone can give me a good explanation, because the information i found on this wbesite don't help me much.
Thanks.
Regards,
Bas
Using templates from the database
-
- Forum Members
- Posts: 110
- Joined: Thu Aug 14, 2008 10:33 am
Re: Using templates from the database
You can best take a look at the news module as this one is well done and in there you can see how it has been done. Also take a look at my post below about the PicasaWebAlbumBrowser as I also managed to do this lately.
Basically you should have:
Hope you can do something with this information.
Basically you should have:
- .tpl files in a template folder;
- modify/create method.install.php and create databasetemplates based upon the .tpl files;
- modify/create action.defaultadmin.php and make the tabs with an edit feature;
Hope you can do something with this information.
-
- Forum Members
- Posts: 110
- Joined: Thu Aug 14, 2008 10:33 am
Re: Using templates from the database
Hello rw,
Thank you verry much.
Now it works fantastic.
Thank you verry much.
Now it works fantastic.
-
- Forum Members
- Posts: 110
- Joined: Thu Aug 14, 2008 10:33 am
Re: Using templates from the database
Well, not perfectly.
I managed to create a field for my template in the cms_module_templates table on install.
I looked at the News module how to create a list of templates in the the tab. But this doesn't work yet.
I used the _AdminCreateTemplateList function. Nothing happens. I used the code in the action.defaultadmin.php and changed it to my prefrences. I only see the title i called:
echo ''.$this->Lang('title_available_templates').'';
I managed to create a field for my template in the cms_module_templates table on install.
I looked at the News module how to create a list of templates in the the tab. But this doesn't work yet.
I used the _AdminCreateTemplateList function. Nothing happens. I used the code in the action.defaultadmin.php and changed it to my prefrences. I only see the title i called:
echo ''.$this->Lang('title_available_templates').'';
Last edited by purplerain12 on Fri Feb 20, 2009 11:16 am, edited 1 time in total.
Re: Using templates from the database
Did you also copied the _Admin... functions into your Moduluname.module.php file?
-
- Forum Members
- Posts: 110
- Joined: Thu Aug 14, 2008 10:33 am
Re: Using templates from the database
Nope, i didn't.
But i do have the option to edit one template from the database. Users can't add a new template now, but that's ok.
I need to have some work for the next version of course
.
Thanks, i will look into this later.
But i do have the option to edit one template from the database. Users can't add a new template now, but that's ok.
I need to have some work for the next version of course

Thanks, i will look into this later.