Reply
Best way to use cookies in WP...?
Old 11-01-2007, 11:24 AM Best way to use cookies in WP...?
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,024
Name: Forrest Croce
Location: Seattle, WA
I'm pretty happy with the category tree I set up for my blog, but it's going to get longer, just like the by month archives. So I went and made all this stuff collapsible. I use some client side scripting to make the ul containers visible or invisible, which seems to be working out. I like it, anyway.

But ... this all runs in the browser, so it doesn't hold state. Collapse and expand things to your taste, go to a different page, and it resets to how I defaulted it. It would be great if I could make all the sidebar items remember how users leave them.

I'm a lot better in asp than php, and I haven't done that much wordpress hacking. Anybody have any ideas how I might go about this, working within the framework of wp? I can set the cookies using javascript no problem ... I can even read them and set the right state for the collapsible regions after the document loads ... but I'd really like to set that on the server side, so people don't get flicker when they navigate around my blog.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
When You Register, These Ads Go Away!
     
Old 11-01-2007, 11:27 AM Re: Best way to use cookies in WP...?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
I don't have your answer, dude, but you get an Unknown Runtime Error on your Javascript in IE7. Just wanted to point that out, that's all.

Nicely done with the category tree! How'd you do that?
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 11-01-2007, 12:16 PM Re: Best way to use cookies in WP...?
jamestl2's Avatar
Web 2.0? What is the Web?

Latest Blog Post:
The Earth is Flat!
Posts: 1,850
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Local_Group / Milky_Way / Solar_System / Earth / North_America / USA / Wisconsin
I haven't used it personally, but this plugin may help out (For collapsing categories):
http://wingingit.cjbehm.com/collapseit

Not sure if cookies is a WP issue, though there is some explanation here:
http://codex.wordpress.org/WordPress_Cookies
__________________
Read this if you are new. | PageRank only applies to Web PAGES!
Learn about the Bermuda Triangle
Who is the Antichrist?


Last edited by jamestl2 : 11-01-2007 at 12:22 PM.
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
Old 11-01-2007, 08:05 PM Re: Best way to use cookies in WP...?
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,024
Name: Forrest Croce
Location: Seattle, WA
I've been trying to figure out that IE scripting error ... when I pull up the rendered source and look at the line and column it complains about, there's an opening div tag, but nothing to do with script...

Quote:
Originally Posted by ADAM Web Design View Post
Nicely done with the category tree! How'd you do that?
Thanks! Categories have the ability to be a hierarchy out of the box ... it's just no one uses that functionality. I went to the manage categories page and assigned most of them a parent, which is shamefully easy. Then I set the template to give each unordered list an ID and toggle it's display style.

I got the cookies to work client side; haven't tried making the server send down the proper state yet.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Reply     « Reply to Best way to use cookies in WP...?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13000 seconds with 13 queries