ThemeForest

Need help with cookies! Not the delicious kind.

7 posts
  • Has been a member for 3-4 years
  • Bought between 10 and 49 items
montanaflynn says

Hello! I purchased The Journey Theme from Koroshiya and was hoping to improve upon it by adding a cookie to save the color a user selects.

Currently if you change pages or reload it goes back to the default blue.

Any veterans can help me out with this I spent a bit of time googling for answers but I am very new to javascript and php.

Thanks.

3 years ago
2942 posts
  • Has been a member for 3-4 years
  • Won a Competition
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Contributed a Blog Post
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Exclusive Author
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 100 and 499 items
  • Australia
  • Referred between 200 and 499 users
DDStudios says

I cant’t help you , but your title is awesome :)

3 years ago
287 posts
  • Has been a member for 3-4 years
  • Exclusive Author
  • Sold between 1 000 and 5 000 dollars
  • Bought between 10 and 49 items
  • Referred between 1 and 9 users
154 posts
  • Has been a member for 3-4 years
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • France
  • Referred between 10 and 49 users
SachaG says

Sorry, I’ve been really busy lately but I promise I’ll take a look and add cookie support soon !

But that article is a good start, I think I used some of that code too.

3 years ago
951 posts
  • Has been a member for 3-4 years
  • Beta Tester
  • Exclusive Author
  • Sold between 1 000 and 5 000 dollars
  • Bought between 10 and 49 items
  • Netherlands
  • Referred between 1 and 9 users
Daan says

I believe there’s also a tutorial on Nettuts, which jeffrey followed in one of his beginner jQuery screencasts, you should take a look there too :)

3 years ago
154 posts
  • Has been a member for 3-4 years
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • France
  • Referred between 10 and 49 users
SachaG says

Here’s the Nettuts tutorial:

http://net.tutsplus.com/tutorials/javascript-ajax/jquery-style-switcher/

I used this technique more or less for my Steelfolio theme, but for Journey I used the first one:

http://www.kelvinluck.com/2006/05/switch-stylesheets-with-jquery/

Neither technique is perfect… that’s why I’m planning to write my own jquery style switcher plugin some day.

In the meantime, here’s how you would add cookie support to Journey.

  1. Download and include the jquery cookie plugin
  2. Add this line to the end of function “switchStylestyle” (the name is stupid I know, I just copied it from that link): $.cookie(‘myStyle’,styleName);
  3. Add this line anywhere in the document.ready() jquery block: if($.cookie(‘myStyle’)){ switchStylestyle($.cookie(‘myStyle’)); }

That’s it ! Don’t forget to do this for all your html files, otherwise it won’t work across the site. I’ve added cookie support to the template files, so if you don’t want to do it manually you can just download them again (I’ll tell you when my update has been aproved and the files are actually updated).

3 years ago
154 posts
  • Has been a member for 3-4 years
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • France
  • Referred between 10 and 49 users
SachaG says

Files have been updated ! enjoy your cookie !

3 years ago
7 posts
  • Has been a member for 3-4 years
  • Bought between 10 and 49 items
montanaflynn says

Thanks so much for all your help, especially you Koroshiya!

3 years ago
7 posts
  • Has been a member for 3-4 years
  • Bought between 10 and 49 items
montanaflynn says

Actually it didnt work, it looks like your template is not working either, at least in Firefox 3 & Safari 4 beta on a mac.

3 years ago
by
by
by
by
by