Check to see if page contains keyword

73 views
Skip to first unread message

Joel Kinzel

unread,
May 10, 2012, 1:44:20 PM5/10/12
to reddot-c...@googlegroups.com
All,

I'm attempting to detect if a page has a particular keyword so that I can take some action on it. Unfortunately I can't seem to figure out how to do this. Here is what I've attempted to do: 

<%!! Escape:Text("<%info_cmsKeywords%>").IndexOf("Feature") !!%>

They keywords for one of the pages does contain "Feature Article", however when I run this, all pages on the list are returning -1 (didn't find the string we searched for). Has anyone done something like this in the past? Also, as a note, I'd like to avoid pre-execute and use of javascript if at all possible. 

Jian Huang

unread,
May 10, 2012, 2:39:03 PM5/10/12
to reddot-c...@googlegroups.com
Try

<%!! Escape:Text(<%info_cmsKeywords%>).IndexOf(Feature) !!%>

Don't need quotes.

Also, try adding .ToString() to the end if needed

Joel Kinzel

unread,
May 10, 2012, 4:08:09 PM5/10/12
to reddot-c...@googlegroups.com
Jian,

Once again, you're the man! It seems to work now, why no one in our office figured to try that I don't know. But all is well! Thanks! 
Reply all
Reply to author
Forward
0 new messages