Where can I find a current module API?

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
100rk

Where can I find a current module API?

Post by 100rk »

:wink:

And for future releases: what about possibility insert {content} into included templates?

Nice work, guys...

--------
English is not my native language :wink:
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Where can I find a current module API?

Post by Ted »

The current module API functions are found in lib/modules.functions.php. This is all changing though in the 0.9 release due out in a couple of weeks. The module API is going to an OO style based on these notes: http://wiki.cmsmadesimple.org/pmwiki.ph ... APIRewrite

I'm not sure what you mean about {content} into included templates, though.
100rk

Tag {content} does not work in included templates

Post by 100rk »

API: yes, but some of functions have no explanation - like a cms_mapi_register_intermodule_function() and more. Implementations of user contributed modules have no examples for using this feature. You know, I am newbie here, so excuse me for interrupting... :oops:

Templates: I mean templates, included by the smarty {include file="file.tpl"} tag. Template included by this way is not 'parsed' by CMSMS, only by Smarty? I really don't like long text in small textarea... :wink:

After implementation OO style module API: will be old-style modules working?

Thanks, have a nice day.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Where can I find a current module API?

Post by Ted »

Oh, I see what you mean.

Yes, normal Smarty tags will work as expected.

As for the API, it won't be backwards compatible. I think it would take A LOT of work to do, and would be of little benifit since there aren't that many modules out there rght now.

And, yes, the rewrite will have some better documentation in it... :)
100rk

What I'm working on

Post by 100rk »

Sorry, I'm really new here, but i very like this system. To be honest, it is big surprise for me - because of simplicity etc.

Included templates: can I from one template include other non-file template directly by some feature of CMSMS? I would like to create 'root' template, and 'sub' template, make 'sub' non-active (I don't need it in combo-boxes at content management), and then by some way include 'sub' into 'root', so all {cms_module} tags (used in both of templates) can work fine.

So, I'm trying to create this module:

- on initialization create instance of some class and save anywhere reference to this object

- on every occurrence his {cms_module} tag in content or template (it will be called more then once - with different parameters), this module will access to only one 'live' object (this object will be created only once in during initialization of this module)

- it will be offer some functions for using by other modules

I agree, OO module API will be certainly more useful for this, but how implement this right now? :wink:

Which callback function of this module have I register for initialization? All my simple experiments doesn't work as I want... Where have I save reference for created object? Is $cms->variables["module_inner_class"] best choice? And how clearly implement inter-module cooperation? I mean which callback functions are used for this task and how other modules uses other-module functions...

It's maybe a little bit hard for a newbie, isn't it? :cry: Can anyone help me? I mean preferably somebody other then developer - his time is too expensive...

I also really don't understand, why is here so few user contributed modules, because CMSMS is very useful system for using by average non-computer peoples...

Lot of questions, I agree. Thanks for any answers.
uptoeleven
Forum Members
Forum Members
Posts: 96
Joined: Sat Dec 04, 2004 10:30 pm
Location: London, England

omg you are mad

Post by uptoeleven »

OK.

Try writing a simple module first - or better still adapting one that is already there - IMO linkblog is the best to work with as it includes a lot of the concepts you need to familiarise yourself with cmsms.
Post Reply

Return to “Developers Discussion”