When I add to my template
<sly data-sly-use.storeLink="${'android' == model.device ? model.appleStoreLink : model.googlePlayLink}"></sly>
I get the following error
My model isDevice looks like:
public String isDevice() {
String userAgent = request.getHeader("user-agent");
if (userAgent.contains("iPhone")) {
return "ios";
} else if(userAgent.contains("Android")){
return "android";
} else {
return StringUtils.EMPTY;
}
}
Any suggestions what I am doing wrong?
Views
Replies
Total Likes
use data-sly-test instead of data-sly-use.
Hi,
Will this always evaluate:
<sly data-sly-test.storeLink="${'android' == model.device ? model.appleStoreLink : model.googlePlayLink}"></sly>
Why does the
data-sly-use
throw an error?
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies