Yola should allow automations!

  • 1
  • Question
  • Updated 9 years ago
Yola should set more automations!

We should be able to set cookies to a user's preferences so next time they return to our site we can make recommendations. This is one of many possibilities!
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
  • http://youcanneverbetoosmart.synthasite.com

Posted 9 years ago

  • 1
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
<!--
I don't think this is exactly what your looking for but to help out and maybe give a few ideas here is the following code:
<html>
<head>
<script type="text/javascript">
function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=")
if (c_start!=-1)
{
c_start=c_start + c_name.length+1
c_end=document.cookie.indexOf(";",c_start)
if (c_end==-1) c_end=document.cookie.length
return unescape(document.cookie.substring(c_start,c_end))
}
}
return ""
}
function setCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}
function checkCookie()
{
zip=getCookie('zip')
if (zip==null || zip=="")
{
zip=prompt('Please enter your zip',"")
setCookie('zip',zip,365)
}
}
</script>
</head>
<body onLoad="checkCookie()">
<a href="test2.html" onClick="this.href+='?zip='+getCookie('zip')">Clicky</a>
</body>
</html>

What this code does is remember the user depending on their zip code that they enter. You can experiment and work around with it. Maybe one day I'll have some time to build a full cookie set, but I have some other Yola projects on my plate right now. Sadly though, some cookies (and perhaps what you want) requires server side coding which I believe is not possible to do with Yola.

Best of luck-Dan

-->
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Thanks for sharing lambofgod. =)
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
ok, thanks :)