Forum Discussion

xorrkaz's avatar
xorrkaz
Genius
14 years ago

How to add Freemarker to text properties?

I would like to override the title of the "Top Category Experts" widget to include the name of the current Category/Board.  I figured I could just embed Freemarker into the text property value, but this does not work.  I just get the literal Freemarker text.  Can someone tell me how I can add dynamic data such as the Category or Board name to this widget's title?  Thanks.

  • I got lucky :smileyhappy:.  I found that if I set the title to "{0} Experts" the zeroth argument is the object title.  So provided this isn't stupid chance, and something I can rely upon, I think I'm set.  Thanks.

  • KaelaC's avatar
    KaelaC
    Lithium Alumni (Retired)

    Sadly, text properties files do not allow freemaker in them.  I can think of some sneaky ways of doing what you want - for example creating a custom component that wraps the standard "Top Category Experts".  You can use freemaker in that custom component to put in whatever header you like, then use CSS to hide the headers that come with the core component.  Not the most elegant solution, but it would work :)

    • xorrkaz's avatar
      xorrkaz
      Genius

      I got lucky :smileyhappy:.  I found that if I set the title to "{0} Experts" the zeroth argument is the object title.  So provided this isn't stupid chance, and something I can rely upon, I think I'm set.  Thanks.