plugin in plugin

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
pishkus

plugin in plugin

Post by pishkus »

Hi all,

i'm still using 0.10 version of cmsms. what i'm trying to do is make one plug-in execute another plug-in. i.e. i have some record in database, i get it with sql query. Let's say the field type is text, and there is some content in it. And among this content there is some tag like {breadcrums} or whatever. If I simply print all the content to the screen I get just the name {breadcrumbs}, but what I need is that I would get the result of the breadcrumbs plug-in.

I hope I wrote it all clear.

Thanx in advance!
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: plugin in plugin

Post by Ted »

Call the actual function that is inside your plugin.  From plugin #1:

Code: Select all

$output = smarty_cms_function_breadcrumbs($smarty, $params);
However, keep in mind that this will not work when you upgrade.  In 0.10, all plugins are loaded by default.  In 0.12 (and maybe 0.11.x...  I forget), plugins are loaded as needed by smarty.  To be honest, i'm not sure of how to do this in the later releases without getting to into the internals of Smarty.
pishkus

Re: plugin in plugin

Post by pishkus »

Hi,

hmm, maybe I described the problem not clear enough, or I don't know how to use wishy's hint :o)

Let's say i have content like this

Code: Select all

Cmsms is nice. Breadcrumbs work like this:
{breadcrumbs}
(above you see plugin working)
I get this information from database in my own writen plugin. And when i print the text to the screen it stays as it is written. But i need it replaced to.

Code: Select all

Cmsms is nice. Breadcrumbs work like this:
Start/News... (etc)
(above you see plugin working)
Well it's not a problem to replace the tag with some standart php function, but things become difficult when there is some extra params like {menu start_id='13'}.
Locked

Return to “CMSMS Core”