cancel
Showing results for 
Search instead for 
Did you mean: 

Adding properties to ws:section

iann
Champ in-the-making
Champ in-the-making
Hi,

Im looking to add some properties to the ws:section type in the model file, mainly to allow a new button to be created to toggle 'launch in new window' on/off.

It doesn't appear that I'm able to access the property in 'top.get.html.ftl' - I presume that properties added to the model aren't automatically picked up?

<#if section.newwindow??> target="_blank" </#if>

Is there any workaround for this / planned feature?

Thanks in advance,

Ian
1 REPLY 1

bremmington
Champ on-the-rise
Champ on-the-rise
Yes, it would be nice to have a generic "properties" field on a section node much like we have on a website node, but we don't at the moment. I'll make a note to add one. In the meantime there are a couple of ways that may allow you to achieve what you're looking for.

One approach would be to add an aspect that has a multi-valued "properties" field to the section landing page (index.html). This is the asset that is loaded when the section is addressed directly, and your custom property would be returned from the repo. I'm not sure if this would enable you to do what you want, but it may do. Another possibility (warning - hack alert) would be to hijack the template mappings that are available on every section and insert a "custom" value. These normally take the format "typename=templatename", but if you were to insert a value like "openInNewWindow=true" then this wouldn't hurt the template resolution mechanism. These values can be read through Section.getTemplateMappings.