Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
cookies...need help
JeffFromAware
can anyone point me in the right for making a cookie. The code I have in a component is this. I put a body tag in a component. When going through the whole process of generating html I notice livesite generates a body tag already so when I put a body tag in a component that will be the second one. Is it possible to have cookies on livesite? and if so does anyone know how to get cookies to work in livesite components???
it doesn't create a cookie but the stuff shows up in the alert.
xsl:text disable-output-escaping="yes">
![CDATA[
script type="text/javascript">
function recentPageCookie(){
document.cookie = "recentPage=" + location.href;
alert(document.cookie)
}
/script>
/xsl:text>
body onload="recentPageCookie()">
Thanks
for any help.
Find more posts tagged with
Comments
Shazzer
Hi Jeff,
Copy and rename the default page layout that you are currently using to output the pages to /iw-home/local/config/lib/content_center/customer_src/src/com/interwoven/xsl/enduser, applying the new custom layout to your pagetype-config.xml file. You can then put your onload="recentPageCookie()" into the body tag on this custom layout without affecting anything else except pages output with this pagetype.
JeffFromAware
thanks for the help. I also saw a post you wrote about incorrect syntax for xpath in the documentation. It was very helpful. Thanks again.
wscott
I recommend putting your code in a separate javascript file, and then including that as a shared resource on your site. Within the javascript file, you can put:
window.onload = recentPageCookie;
This will replace the onload handler for the body element. This way you don't need to write a body tag in your component xml or mess with the page layout stylesheet.