SiteVision Onlinehelp
Search

How do I get the target from a sv:link?

Question: How do I get the link target if I'm using a version of SiteVision that does not have a 'target' property on sv:link nodes?
To get the target node of a sv:link use the URI property.

var link = ...;
var linkTarget = link.getProperty("URI").getNode();

This can also be done by using one of our utility classes, PropertyUtil.

var propertyUtil = request.getAttribute("sitevision.utils").getPropertyUtil();
var link = ...;
var linkTarget = propertyUtil.getNode(link, "URI");

This method will not throw an exception if the target is not valid, it will just return null.

Last updated:

se-sto-ste-sv5-1.sitevision-cloud.net
3.14.80.45