I have a page whose title is being set to, let's say, "foo".
I have a component contained within that page (across all the 3 pages referenced, really) who contains 3 links. I'm attempting to compare the _page-leve_ property title with the _component-level_ property linkXtext:
<a href="mypage1.html" class="tab ${properties.jcr:title==properties.link1text ? "active" : ""}">{properties.link1text}</a>
<a href="mypage2.html" class="tab ${properties.jcr:title==properties.link2text ? "active" : ""}">{properties.link2text}</a>
<a href="mypage3.html" class="tab ${properties.jcr:title==properties.link3text ? "active" : ""}">{properties.link3text}</a>
The respective values of said linktexts being
1 = sna
2 = foo
3 = bar
The underlying theory here being that, should the two strings match, the classNam active will be appended, otherwise, omitted.
I can read the linkXtext no problem, but the page title seems to elude me. Thoughts?
Solved! Go to Solution.
Hi,
${properties.key} will return the value if variable is present in the component, I think you are trying to read page level property inside a component. In that case you can use
${pageProperties['jcr:title']}
When reading value having : the above format works.
Hope this helps.
Hi,
${properties.key} will return the value if variable is present in the component, I think you are trying to read page level property inside a component. In that case you can use
${pageProperties['jcr:title']}
When reading value having : the above format works.
Hope this helps.
Thank you so much for the help.
Views
Likes
Replies
Views
Likes
Replies