TinyPortal

General => Chit chat => Topic started by: iowamf on November 21, 2005, 09:09:09 PM

Title: nifty "collapse" feature on blocks that showed up recently
Post by: iowamf on November 21, 2005, 09:09:09 PM
Wow - that's a great new feature.

I bet many are wishing you'd turn 0.8 loose ... that feature alone is killer.

Note, I have tried to remove all the buttons from the top and would like to put the right "upshrink" next to where you put that little collapse icon ... could you let us know how you put that collapse icon in the content bar?  I'd like to try and add the right upshrink button there.

Might have to nominate TinyPortal.NET for TP site of the month ... just kidding of course  ;)

[attachment deleted by admin]
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: crip on November 21, 2005, 09:14:06 PM
I saw that also.. very cool indeed!  O0
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: Nokonium on November 21, 2005, 10:17:28 PM
That really is neat, (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.nokonium.plus.com%2Fblack-cat%2Fhappy%2F25_coolguy.gif&hash=becf8e0113ba2e947d863fd2b1b29413b0db7d1e)

But  :-\  you seem to have done something else at the same time, the left sidebar has had a trim.

[attachment deleted by admin]
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: bloc on November 21, 2005, 11:48:09 PM
Nokonium, I see it. Opera again.  ;) will correct that.

iowamf, its just the a image right-aligned placed first in the the containing div of each block. Currently the code look like (TPortalBlocks.template.php):

...
....
     }
     echo '<div', ($theme ? ' class="tborder"' : ''), ' style="margin-bottom: 5px;">
<a href="javascript: void(0);" onclick="toggle(\''.$block['id'].'\')"><img style="margin: 4px;" align="right" src="'.$settings['images_url'].'/collapse.gif" border="0" alt="" ></a>';

     if ($theme || $block['frame'] == 'title')
....
....
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: Nokonium on November 22, 2005, 06:56:57 PM
Quote from: Bloc on November 21, 2005, 11:48:09 PM
Opera again.ÂÃ, 

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.nokonium.plus.com%2Fblack-cat%2Fnaughty%2Fblah1.gif&hash=d4de5d2dc995f8c67d0089b2b3c65fe1cad59e99)
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: Maya on November 26, 2005, 09:37:26 AM
Okay I popped the code in np, and they showed up, no sweat... but it is almost like they aren't linked.. nothing happens ..no collapse

I hope I didn't miss something really dumb ???

(I love these though, it gives a personal flexability to the site...)
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: Skhilled on November 26, 2005, 03:44:07 PM
I tried it and got a javascript void(0) and no image, just a place holder... Tried putting the gif in almost every image dir I could think of...
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: snork13 on November 26, 2005, 04:58:36 PM
they are not showing up because where you place the code the image request is from
.$settings['images_url'], but  $settings is not defined above ;)

ie

function TPortal_sidebar($side)
{
   global $context , $settings, $scripturl;
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: Skhilled on November 26, 2005, 05:21:30 PM
Ah, ok. Did that but still get the same error and errors on page. But now I do see them but not working.
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: Maya on November 26, 2005, 05:28:49 PM
Mine are there but aren't working either, i think its missing a code snippet is all..
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: bloc on November 26, 2005, 06:52:07 PM
Thanks, snork.. the code is just a indication really, since I changed more for this new upshrink feature. Don't use the javascript link AT ALL. It assume the actual 'toggle' routine to be present, which you don't have yet. :)

use only..
<a href="-something-"><img style="margin: 4px;" align="right" src="'.$settings['images_url'].'/collapse.gif" border="0" alt="" ></a>';



Of course adding a link and your own image name there - if you want a image there(and a link).
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: Skhilled on November 26, 2005, 07:16:29 PM
When I saw the js error I thought that might be the problem. Which directory should the code be in? Tinyportal75 or in themes?
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: Skhilled on November 26, 2005, 07:32:30 PM
Hmm, I don't get it... Why have a link at all? Why not just the expand/collapse?
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: bloc on November 26, 2005, 08:28:28 PM
Because the javascript I use require a proper link. Doesn't work with just a onclick on the image. Also it needs to save this info for each member over all themes. SMF upshrink works on just current theme, and is tailored against one particular upshrink. So I wrote my own version for the blocks upshrink.
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: Skhilled on November 26, 2005, 08:32:20 PM
Ahhhh, so you must put a different link according to the type of block? BTW, why not just call them Blocs?ÂÃ,  LOL

Still can't get it to work cause of the links. Not actually sure which links to put in them.
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: snork13 on November 26, 2005, 11:05:46 PM
not sure if this will help

http://www.michaelhanscom.com/eclecticism/2004/01/javascript_togg.html (http://www.michaelhanscom.com/eclecticism/2004/01/javascript_togg.html)

::)
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: bloc on November 27, 2005, 01:08:21 AM
:D Thats the one i started out with..but the saving of the value into the database was the challenging part.

kind of useless if a page refresh just sets all blocks open again...
Title: Re: nifty "collapse" feature on blocks that showed up recently
Post by: Skhilled on November 27, 2005, 07:27:01 AM
That link gives me a page not currently available...

Quote from: Bloc on November 27, 2005, 01:08:21 AM
kind of useless if a page refresh just sets all blocks open again...

Yeah, kind defeats the purpose. :)