case insensitive xpath select
Hello,
We are currently using a custom metadata field on images and pages to link the two together for our faculty bios. The field contains the users email address.
Right now, this works as long as they are both the same case.
For instance First.Last @ ung.edu
won't match
first.last @ ung.edu
Below is a few of the key lines from the format.
1. #set($page = $_XPathTool.selectSingleNode($contentRoot, "/system-index-block/calling-page/system-page"))
2. #set($email = $_XPathTool.selectSingleNode($page, "dynamic-metadata[name='email']").getChild("value"))
3. #set($query = "system-file[dynamic-metadata[name='email' and value='" + $email.value + "']]")
4. #set($images = $_XPathTool.selectNodes($control.getChild("images").getChild("content").getChild("system-index-block"),$query))
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ryan Griffith on Apr 26, 2013 @ 03:09 PM
Hi Justin,
I believe your best bet here would be to surround value with a
translate()
statement to convert it to lowercase, then also convert$email.value
to lowercase, so you can match the two up. For example:Please let me know if you have any questions.
Thanks
2 Posted by Justin "JE... on Apr 26, 2013 @ 03:18 PM
Thanks, that did it!
Justin "JET" Turner closed this discussion on Apr 26, 2013 @ 03:18 PM.