I've got 2 user input fields which allows users to select either an internal page via the content picker, or provide a url to an external page via a text string field. However I've noticed that if the user doesn't include http:// in the url they provide, it simply appends it to the current url as if it were a folder on the current site.
What i'd like to do is check whether the text string contains 'http://' and if not, add it manually in the xslt. What would be a suitable way of doing this with xslt?
check user input string contains 'http://'
Hi all,
I've got 2 user input fields which allows users to select either an internal page via the content picker, or provide a url to an external page via a text string field. However I've noticed that if the user doesn't include http:// in the url they provide, it simply appends it to the current url as if it were a folder on the current site.
What i'd like to do is check whether the text string contains 'http://' and if not, add it manually in the xslt. What would be a suitable way of doing this with xslt?
Thanks in advance, Phil
Hi Phil,
When you're about to output the value - do like this:
It's not foolproof, but will catch most cases :-)
/Chriztian
You might also want to look at uComponents, as this contains a URL Picker ( http://ucomponents.codeplex.com/wikipage?title=UrlPicker ) data type which will handle your 2 input fields within 1 interface.
is working on a reply...