Return to Jive Software

This Question is Answered (go to answer)

2 "helpful" answers available (2 pts)
246 Views 2 Replies Last post: Nov 9, 2009 6:33 AM by ChrisRoush RSS
ChrisRoush Novice 84 posts since
Jul 14, 2009
Currently Being Moderated

Nov 6, 2009 11:34 AM

Theme changes within a plugin

Hello,

 

I am curious to know whether it is possible to change the theme of a certain UI compenent inside of a plugin. For example, if I want to write a plugin to change the CSS of the user-bar component only when several conditions are met, is it possible to have the plugin point to a new FTL file?

 

Any help would be appreciated.

 

Chris

jongarrison Novice 27 posts since
Nov 16, 2007
Currently Being Moderated
Nov 6, 2009 2:26 PM in response to: ChrisRoush
Re: Theme changes within a plugin

Hi Chris,

    It is possible to get the result that you want.  In your plugin, create a struts action that renders some css based on the conditions you are checking.  In your theme's /template/decorator/default/template.ftl put the following line in the head of the page (next to the system's identical "custom-css" line):

 

<style type="text/css"><@s.action name='your-plugin-css-action' executeResult='true' ignoreContextParams='true' /></style>

 

   You might want to look at using freemarker from within /template/global/custom-css.ftl to check your conditions directly.  Depending on what you're trying to do, you may be able to avoid having to create the struts action in the plugin.

 

-Jon

 

Swift Notion Software LLC

Expert Jive Customization

More Like This

  • Retrieving data ...

Bookmarked By (0)