Min Button Hack
"Brian Lindner" <[email protected]> Sat, 7 Sep 2002 14:21:15 -0400
| Newsgroups | gmane.comp.web.envolution.devel |
|---|---|
| Message-ID | <000101c2569b$5d6d02a0$6501a8c0@Gohan> |
Since I know the Envolution update package is being worked on.. I wanted
to get this out to the dev list first before I do my formal release to
envoltion.com Its not a bug fix.. But an enhancement! maybe their is
time left to get it in..
Envoltuion DTHML MinBox Hack
By: Furbo
Ok, so everyone knows more or less that the MimMax 'button' for blocks
is a pain. Modifies the title of blocks
People have written better JS scripts to help out but it requires a
theme by theme change.
(see http://www.baohx.com for example in use
and
http://themes.postnuke.com/modules.php?op=modload&name=News&file=article
&sid=254&mode=thread&order=0&thold=0 for the script source i used)
No more! With this hack not only does the code for the dhtml button go
into the core BUT the admin can now
choose which MinMax button style they like (a new config var)..
the default style that calls the server or a nicer dhtml front end
only solution
PLUS... as a bonus. the min button is now Not a part of the
$block['title'] var so no more having those pesky buttons messing up
layouts.
a new Encompass variable [-$MINBOX-] has been created so you layout
people can place the button (either version) anywhere you like.
If you dont want the button in your theme at all, simply dont use
[-$MINBOX-] in you block templates! All the work is inside the core
Add [-$MINBOX-] to any block templates you use for your theme, left,
right, default, top.. whatever....
it will only show in those templates that u choose to have it in. Full
control!
INSTALL:
BACKUP!!! Just in case. This is a hack
1) copy the files in the html folder to you document root
Envolution Core Files Changed:
/modules/Encompass/pnclasses/Encompass.php
/includes/advblocks.php
/header.php
2) In your theme templates for blocks add [-$MINBOX-] where you want the
min box to display
3) Copy plus.gif and minus.gif to your themes/images folders... (you can
pick whatever you want for the 2 images though)
In the Envolved template sample folder... i included my modified right
and left block templates so you see that the minbox is now separate from
title...
4)
now.. it will work out of the box but will default to standard button
display. BUT to truly get some control over things
install my new config var using the insert below... Change PREFIX_ to
your prefix
dhtml_block_minimize = 1 --- use DHTML min button
dhtml_block_minimize = 0 --- use standard PN/ENvolution style
SQL insert for config var:
INSERT INTO PREFIX_module_vars (pn_modname, pn_name, pn_value)
VALUES ('/PNConfig', 'dhtml_block_minimize', 'i:0;');
sorry, but for now.. you have to manually change the value in the db..
no admin screen, Yet....
now you can place the button where you want.. and pick how you want
users to see the button
Ex: a alot of us have this in templates
<td >[-$TITLE-]</td>
now you can have to get the min button separate and to the right side
<td >[-$TITLE-]</td>
<td width="10">[-$MINBOX-]</td>
You can see a Demo at:
http://sigtauonline.com - i have only left and right blocks showing the
min box for my theme
and
http://dev.sigtauonline.com - modified Envolved theme.
While your there (dev.sigtauonline.com) you can check
out my next version of the NS-Poll block
Download minbutton hack from: (or downloads section of the main site)
http://sigtauonline.com/modules.php?op=modload&name=Downloads&file=index
&req=getit&lid=2
Thanks MACscr for pointing out the nice dhtml script to me and the
input.
Enjoy the hack.. hopefully it can make it into the Core and can config
from a screen..
(just didnt have time to write that part yet)
Furbo :)