Hi,

I'm planning to use Drupal as a framework for an intranet, in this kind of setup I guess it'll end up with a lot of side blocks. So I started to code some javascript functions to make then collapsible.

The current approach runs a Javascript function on page load which parses the document and modifies all the blocks to attach a header to them, which when is clicked collaps/expands the block.
The state of the blocks is stored in a cookie, so if some block is collapsed it'll continue to be even on page change or reload.

So far this works great, however I'd like to make it work for several users even when using the same computer/browser, so I need to generate a cookie based on the user ID. Since I'm new to Drupal I'm not sure which could be the best approach to this.

I'm thinking to create a module which loads the javascript code with the onload hock and sets a javascript variable with the user ID. Although I'm not sure if this is the best approach.

Any suggestions?

ivan

Comments

kbahey’s picture

Not exactly what you are looking for, but a way to do collapsible blocks of sorts.

http://drupal.org/node/18941
--
Consulting: 2bits.com
Personal: Baheyeldin.com

--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba

DrSlump’s picture

Not exactly what I'm trying to do.

I've put online a little demo, it's an static page so the links don't work. Anyway the current implementation is totally in the client side so the blocks keep the status even on page refresh/change.

http://drslump.biz/temp/collapsible/

Perhaps someone would like to co-author this and integrates this into drupal ;)

ivan

rivena’s picture

Very pretty!

I wonder if this info would help.
http://drupaldocs.org/api/head/file/includes/session.inc

Anisa.

------------------------------------------
www.animecards.org

14,702 card scans and counting!
------------------------------------------