[Solved] How to use database template in new module

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Duketown

[Solved] How to use database template in new module

Post by Duketown »

Hi, I have looked for coding in News, Quizzard and a couple of others. What I can't really detect/find is how templates stored in _module_templates are handled. I'm able to retrieve the template, but all mentioned modules seem to handle the template update/storing in a different way.

Questions that I have:
1 - Which module contains a straightforward method of handling database templates?
2 - Would it not be a great thing if one of the handling is in the developers documentation, so new developers develop in a similar way (and thus pushing the quality of the module to a higher level)?

Thanks,

Duketown
Last edited by Duketown on Wed Oct 17, 2007 9:59 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: How to use database template in new module

Post by calguy1000 »

The questions module handles multiple database templates in a relatively straightforward way.  The database templates are handled with the 'SetDatabase' and 'GetDatabase' call.

The questions module is a good clean example module to work with. 

But yes, the developers docs need updating.  We've been too busy working writing them to worry about documenting the process.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Duketown

Re: How to use database template in new module

Post by Duketown »

OK,
Thanks calguy1000. I'll try the questions module.
I do understand the part of the documentation with so much going on at this moment. And as in many cases the documentation is following after some time.
Duketown

Re: How to use database template in new module

Post by Duketown »

All,

I did some homework and prepare a step-by-step guide on how to include a database driven template.
You can find it in the developers part of wiki: http://wiki.cmsmadesimple.org/index.php/User_Handbook/Developers_Guide/Creating_Modules#Insert_database_driven_templates

Have fun with it,

Duketown

The guide was prepared and tested with version 1.0.8
Post Reply

Return to “Developers Discussion”