Can smarty parameters be made available in other module hooks?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
dotnet

Can smarty parameters be made available in other module hooks?

Post by dotnet »

Smarty parameters are available in DoAction, but is there some way to make them available in other module hooks, such as ContentPreRender?

I am developing a module for JSCookMenu, and I would really like to have a Smarty parameter for specifying the theme. This parameter would only be useable if it were available in ContentPreRender and ContentStylesheet where the javascript and css includes are specified.

I hope this is not a dumb question.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: Can smarty parameters be made available in other module hooks?

Post by Ted »

Actually, it's not dumb at all.  I guess I never thought about doing this, but it does make sense.

Here's the main issue as why this kind of stuff doesn't exist.  What happens if a module is included twice on a page?  What parameters does it get?  Should ContentPreRender and all that be called for each instance with different parameters?  What happens if it's a module that doesn't need to be included on a page?  Should that get called

One way around it is to set parameters on the content object itself (using proper references) or throwing variables in $gCms->variables (again, using references properly).  DoAction is called before those other methods (I believe) and should probably work well.

Though, I agree it would be easier to have the params available.  We should probably come up with a good way of handling it that makes sense.
urbieta

Re: Can smarty parameters be made available in other module hooks?

Post by urbieta »

The xajax website loads once and displays all content faster across linking!

http://xajax.sourceforge.net/

Can this be done with cmsms?

This sounds to me like WAY lower bandwidth use under low and high traffic sites because the data travels only once per visit, not multiple fractions per visit.

Once inside the website, browsing through it is WAY faster because it is already loaded!

Maybe an html code preload only and load images when the particular section that contains them is called to avoid a long wait for the site to appear?

Am I dreaming here? or is this possible? ...erp, how? ;)

thanks! :)
Locked

Return to “Modules/Add-Ons”