contentAttribute

This tag will get you the value of a named attribute in a content, either bound though a property or referenced by a content id.

Parameters

Name

Req.

Def.

Type

Description

id

true

 

String

The result is stored in this variable.

contentId

false

 

Object/String

The id of the content you wish to get the attribute value from.

propertyName

false

 

Object/String

The property name the component used to bind the content by in which you wish to get the attribute value from.

languageId

false

 

Object/String

The id of the language you wish to get the attribute in. Default the language the user is browsing the pages in is used.

contentVersion

false

 

Object/String

The ContentVersion object you want to get the attribute from if you have that available directly.

attributeName

true

 

Object/String

The name of the attribute you wish to get.

disableEditOnSight

false

false

Object/String

If set to true the component editor will not decorate the attribute for rightclick actions. A must if the attribute is to be inserted in a html attribute.

useAttributeLanguageFallback

false

false

Object/String

If set to true InfoGlue will fallback to the master language version if no attribute was found in the current language.

useInheritance

false

true

boolean

Sets if the component should look for other articles on other components with the same propertyname, either on the same page or on pages above. useStructureInheritance overrides the structural inheritance but not the local.

useRepositoryInheritance

false

true

boolean

Sets if the component should use repository inheritance when looking for inherited items.

useStructureInheritance

false

true

boolean

Sets if the component should use inherit properties from it’s parent site nodes.

parse

false

false

Object/String

If set to true the article will be parsed and any code in the text will also be executed.

fullBaseUrl

false

false

Object/String

If set to true any references to either assets or pages will be given as full URL:s and not as relative ones.

mapKeyName

false

 

Object/String

If set the tag assumes that the attribute pointed out by the attribute name is a name-value parameter map and that the attribute we want is found in there.

 

ID-result variable contains:
The string found in the sought attribute.

Examples

The following example gets the content attribute "Title" from the content bound by the component property "Article".

<content:contentAttribute id="title" propertyName="Article" attributeName="Title"/>
<h1><c:out value="${title}"/></h1>
The next example does the same but turns off the javascript decoration on it.
<content:contentAttribute id="title" propertyName="Article" attributeName="Title" disableEditOnSight="true"/>
<a href="http://www.infoglue.org" title="<c:out value="${title}"/>"><c:out value="${title}"/></a>



comments powered by Disqus