The normalize-space is used just in case the headerImage is a normal text string where user can type the ID, in that care the user will be able to type a space in the field wich will conflict with XSLT "like" function. So normalize-space is removing all space after and before the ID. But if you are using a mediaPicker then it is not that needed.
Yeah, like Srdjan says the normalize-space will strip all spaces in eny given string. And in the use of a media picker you might not need it (haven't tested that, but it makes sense).
You can use the normalize-space in other situations like if you have a string like this:
<xsl:variable name="ourString">This is a string</xsl:variable> <xsl:value-of select="normalize-space($ourString)" />
The above would output: Thisisastring
Can be usefull in situations where you might want to use some text (with spaces) as a class on a div or something like that.
Recursive Media Macro
Hi,
I'm using a macro to put an image in my template with the new Schema. How could I make it so it is recursive incase someone doesn't choose an image?
My Code is as follows:
I've tried things like this but am not sure if it is the old schema or I'm just doing something wrong:
Thanks for any help!
Amir
Hi Amir
Try taking a look at Chriztian's answer in this post.
By using that solution I think you could do something like this:
/Kim A
Kim,
That worked great! What is the reason for the normalize-space in there? Not sure I've seen that before.
Thank you for your help,
Amir
Hi Amir
The normalize-space is used just in case the headerImage is a normal text string where user can type the ID, in that care the user will be able to type a space in the field wich will conflict with XSLT "like" function. So normalize-space is removing all space after and before the ID. But if you are using a mediaPicker then it is not that needed.
Hi Amir
Yeah, like Srdjan says the normalize-space will strip all spaces in eny given string. And in the use of a media picker you might not need it (haven't tested that, but it makes sense).
You can use the normalize-space in other situations like if you have a string like this:
The above would output: Thisisastring
Can be usefull in situations where you might want to use some text (with spaces) as a class on a div or something like that.
/Kim A
is working on a reply...