Trying to build a very basic module
|Posted: Tue, 2007-05-22 23:24|
I have some programming background, but not in php. I'm trying to build a very simple gallery 2 module that creates a sidebar block with up to 3 admin specified urls in it. This will provide links that my users can click to jump out of gallery and into other content on related web servers.
I have a medium sized multi-site installation that require unique url links each. I had created these links in the past by creating a theme (a copy of Matrix) for each site and writing the urls directly into the local/sidebar.tpl files of the themes. However, all my themes broke when I upgraded from 2.1.0 to 2.2.1. So I think it would be easier in the long run to write one module that could be shared between all the multi-sites, that each multi-site can configure for the specific link section that it needs.
I can activate my module, and I can select the "Ext URL" block in the sidebar configuration dialog in the matrix theme. The default entries come up OK.
The part I'm missing is how do I write the module's entries into the database, so that the correct values appear in my .tpl code when gallery renders a page? I suspect I need a some kind of store function in a Callbacks.inc file, but I've just not been able to get it figured out.
How do the database entries for a specific module get written to the db when the admin saves a configuration page?
I've spent a fair bit of time looking through the various developer resources, but I just haven't found a sort of beginners description of how a Callbacks.inc file should work and what the calls / syntax need to be.
I would appreciate any help or pointers you could give me on how this should all work! I welcome collaborators!