Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello,
Ive got a banner xslt script which shows a banner on a specific page.
Now i want to add a property called "Show only once"
If this property is set to true the banner should only be shown once.
I think the best method to do this is to store a cookie and look if the cookie still exists
Anybody any idea how to handle this?
Thanks
Hi,
You can retrieve the cookie in XSLT using
<xsl:value-of select="umbraco.library:RequestCookies('nameOfCookie')"/>
Rich
Hi Dominik
You could also consider using the jquery.Cookie plugin to create the cookie - read more about the plugin usage here: http://www.electrictoolbox.com/jquery-cookies/
/Jan
yes i got it but how can i get any umbraco media type id into this cookie ?
i tryed the following:
$.cookie("banner-layer", "<xsl:value-of select="$mediaNode" />", { expires: 7 });
But the cookie value is null
ok it works now - sorry
Happy to hear you got it solved.
Are you using the xslt extension to read the cookie or do you use the cookie plugin for that? (Being curious :))
I read and store the cookie via xslt an jquery inside the XSLT and it works great
Thanks for your help
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Store cookie in XSLT
Hello,
Ive got a banner xslt script which shows a banner on a specific page.
Now i want to add a property called "Show only once"
If this property is set to true the banner should only be shown once.
I think the best method to do this is to store a cookie and look if the cookie still exists
Anybody any idea how to handle this?
Thanks
Hi,
You can retrieve the cookie in XSLT using
<xsl:value-of select="umbraco.library:RequestCookies('nameOfCookie')"/>
Rich
Hi Dominik
You could also consider using the jquery.Cookie plugin to create the cookie - read more about the plugin usage here: http://www.electrictoolbox.com/jquery-cookies/
/Jan
yes i got it but how can i get any umbraco media type id into this cookie ?
i tryed the following:
But the cookie value is null
Thanks
ok it works now - sorry
Hi Dominik
Happy to hear you got it solved.
Are you using the xslt extension to read the cookie or do you use the cookie plugin for that? (Being curious :))
/Jan
I read and store the cookie via xslt an jquery inside the XSLT and it works great
Thanks for your help
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion