Subject: Draggable Block Hack

Posted on: 14/04/04 05:44pm
By: Turias

Right on the heels of the collapsable blocks hack comes another one that will blow your mind! Unfortunately, it is also completely useless.

Check it out at:

Draggable Block Hack

Posted on: 14/04/04 06:22pm
By: Blaine

Nice work Turias It shows possiblities though. I like the floating divs.

I guess, one could somehow read back the x,y coordinates and then apply some rules. I've used a commercial portal that allowed you to move blocks between the 3 colums and positions within each col - pushing others down or up automatically. I can just imagine the Javscript kungfoo to make that all work.

I like the collapseable sides. I have asked a few theme designers to consider doing something like this for geekyears I've seen nuke themes that have a small icon on each block title that allowed you to collapse a block as well.

This is good for say the admin block that gets pretty large at times. Thats why I implemented the milonic menu on my site so that I could combine all my menus and save screen real-estate.

Draggable Block Hack

Posted on: 14/04/04 06:53pm
By: Turias

[QUOTE BY= Blaine] I've seen nuke themes that have a small icon on each block title that allowed you to collapse a block as well.[/QUOTE]

I've actually thought about doing this, but it doesn't seem possible with the current core. Each block on the site needs to have a unique id if you want cookies to be able to remember which blocks are open and which are closed. I don't see much point in collapsable blocks if you have to collapse them each time you load a page.

Correct me if I'm wrong, but it seems as though the only variable that gets passed into the block theme files is the block_title. So, that's all we have to work with.

Ok, so maybe we can assume that the title is unique. But, how do we get it into a javascript variable? That's where I'm stumped. If the title has either a single or double quote inside of it, the Javascript flatout breaks.

The way I see it, there are two ways to patch the core to allow this functionality:
1) Set the unique block_name variable in the themefiles (I'm assuming quotes can't be in that variable, but I haven't tested to see if GL allows it). This seems to be the correct fix for this particular problem.
2) Allow for escaping of geeklog variables so that they can be used in javascript. For example, [x_js] could be the javascript-escaped version of the [x] variable. I could see this being quite useful for other applications if it were done automatically for every theme variable.

So, that 's what has been running through my head this week. Do you see anything that I'm missing? Any ideas that might work?

Draggable Block Hack

Posted on: 15/04/04 07:52am
By: Turias

Well, I give up. I can't think of anything else, right now. I'll take a look at the core and see how extensive the changes would need to be. If one of them isn't too bad, I'll see what Dirk thinks about putting it in the core.

Draggable Block Hack

Posted on: 06/02/05 03:59am
By: trinity

createing individual colapsiable blocks is as easy as wraping the block content in a div and setting the div atrabute to hidden

Draggable Block Hack

Posted on: 06/02/05 08:09am
By: sammykrupa


Draggable Block Hack

Posted on: 06/02/05 10:24am
By: ByteEnable

I checked it out. That is pretty cool.

Geeklog - Forum