I have a String for a content ID in a loop, I want to compare it with the current page’s content ID. Both are meant to be of type java.lang.String, but I can’t get anything more useful than “[Ljava.lang.String;@cb9cfa” out of the latter.
$sys.params is supposedly a Map<String, String>, but that is what I get out of $sys.params.get(“sys_contentid”).toString().
But it always returns false. Inspecting the two values, $sys.item.getProperty(“sys_contentid”).String gives me exactly what I’d expect it to, but $sys.params.get(“sys_contentid”).toString() only ever gives me a nonsense value like “[Ljava.lang.String;@cb9cfa”.
If it makes a difference, this is in rffSnTitleLink, called from uswSnUKNavRightNews (a snippet of ours) as
I’m trying to determine whether or not a snippet inside a for loop is referencing the page containing that snippet or not.
We’re building a news archive. The right-hand side of the page contains a list of the latest articles. I need to be able to tell, in the context of this list, whether each item is the same article as the page containing the list, so we can highlight the current article in that list.
I just can’t find a way to do this. I can’t believe there isn’t a way, I just don’t seem to be able to work out how to get Velocity and Rhythmyx to get me access to the right variables. My code reads:
But $pageID (which should be the calling page’s ID) and $sys.item.getProperty(“sys_contentid”).String are always coming out with the same value — the ID of the page inside the loop, not the containing page.
$sys.item always points to the current item you are assemblying. Are you doing this in a navigation template? If so, then you’ll get the GUID of the Navon. If you’re doing it directly on a page template, I’d expect you’d get the GUID of the page itself.