Page 1 of 1

plugin in plugin

Posted: Wed Feb 15, 2006 10:05 pm
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!

Re: plugin in plugin

Posted: Thu Feb 16, 2006 3:27 am
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.

Re: plugin in plugin

Posted: Thu Feb 16, 2006 10:07 am
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'}.