Page 1 of 1

[Solved] How to use database template in new module

Posted: Sun Oct 14, 2007 7:10 pm
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

Re: How to use database template in new module

Posted: Sun Oct 14, 2007 8:29 pm
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.

Re: How to use database template in new module

Posted: Mon Oct 15, 2007 2:58 am
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.

Re: How to use database template in new module

Posted: Wed Oct 17, 2007 9:58 pm
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