Is it possible to compare a page property with a component property within a component?

Avatar

Avatar

rajashekhar0621

Avatar

rajashekhar0621

rajashekhar0621

09-02-2018

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?

View Entire Topic

Avatar

Avatar

rajashekhar0621

Avatar

rajashekhar0621

rajashekhar0621

09-02-2018

Thank you so much for the help.