Hi Bao,

On Sa, 2010-06-26 at 17:03 -0700, Bao wrote:
> 
> I tried ${media} and got following:
> 
> >Error on line 4, column 3 in module/paragraphs/teaser/teaser_img_bg.ftl
> >Expecting a string, date or number here, Expression media is instead a
> freemarker.ext.jsp.TaglibFactory$Taglib
> >The problematic instruction:
> >----------
> >==> ${media} [on line 4, column 1 in
> module/paragraphs/teaser/teaser_img_bg.ftl]
> >----------
> 
> So this taglib is recognized, but why can't I use it?
> >> I also tried to use some functions like ${media.url(img)} and I get the
> >> same error "bla bla media.url not found"
> >> 

The problem is, that you want to use am EL function and EL functions are
not supported in Freemarker.
You can use the "${media.url(img)}" syntax only in STK templates because
the MediaEl class is made available in the context by the special
template renderer provided by openmindLAB.

If you want to use the media EL functions in non-STK freemarker
templates you have to define your own template renderer and overwrite
the setupContext method. Have a look at the
SktSimpleMediaTemplateRenderer [sic!] class provided by openmindLAB.

Note that if you put a 'media' bean in the context, you cannot in
include the media taglib with the same name.

hth
Chris


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to