AnsweredAssumed Answered

How do I access custom Section properties from a template?

Question asked by punekr12 on Aug 22, 2012
I am trying customizing the WCMQS webapp in the Alfresco 4.0.e.

As part of this I added a custom Association in the "ws:section" type called "ws:bannerImage". This is supposed to be a banner that will be shown for all the articles contained in that section.

The target for this association is "ws:image" and I am able to attach the image in share.

However I couldn't figure how to display this image as banner in the freemarker template - style1.get.html.ftl.
After looking at some similar templates I tried -
        <#if asset.containingSection.associations['ws:bannerImage']??>            
            <#assign image=asset.containingSection.associations['ws:bannerImage'][0]>            
          <div id="banner" style="background-image: url(<@makeurl asset=image />); ">

Which did not work. Probably because it does not know there is an association like that.
I also tried - asset.containingSection.relatedAssests , asset.containingSection.propeties. those don't work either.

What am I missing here? do I have to modify and build the WCMQS API? what is the best way to do this?

thx

Outcomes