• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Show Hide Node Blocks

Cezz

Well-known member
#1
Description
---------------------------------------
I was asked to create a simple modification that would allow for the categories in the forum home to be expanded/contracted.

This is what I have created. I hope you like it, any questions please just ask.

The entire process is pure JS and has only been tested on the default template if you changed some parts of the template you may stop this working completely OR stop the session being recorded and so the show/hides don't save between page loads.

Some Screens
---------------------------------------

screen1-expanded.png screen2-collapsed.png

Installation
---------------------------------------

STEP 1
--------------------------------------
Import the XML product through your Admin CP
Admin CP > Development > Install Add-On > Select 'addon_showhideNodes.xml'

STEP 2
--------------------------------------
Edit your "page_container_js_body" template to include the box
Admin CP > Appearance > Templates > Search for 'js_body' > Click 'page_container_js_body' to edit

Scroll right to the bottom of the template and add:

<xen:include template="showhideNodes_JS"></xen:include>
<xen:include template="showhideNodes_CSS"></xen:include>

STEP 3
--------------------------------------
If you want to change the Default style of the expand/colapse code you can do this by editing
the "showhideNodes_CSS" Template.

Admin CP > Appearance > Templates > Search for 'showhideNodes' > Click 'showhideNodes_CSS' to edit

Alternatively you can remove the second include from the page_container_js_body and add the CSS to
one of the main CSS files.
UPDATES - Version History
-------------------------------------


  • v1.0.0 - Initial Build
  • v1.1.0 -
    • Fixed - Issue with cookie array meaning that wrong element would get removed.
    • Fixed - Added phrases to the master template.

Credits
---------------------------------------
The idea for the mod came from Forsaken and I must note that disjunto was a great help in fixing some issues.
 

Attachments

Forsaken

Well-known member
#5
Way not to mention the person who told you to make it ;(.

You can't place the any divs around the category/forum, otherwise it won't work properly.
 

Forsaken

Well-known member
#11
Description
---------------------------------------
I was asked to create a simple modification that would allow for the categories in the forum home to be expanded/contracted.

This is what I have created. I hope you like it, any questions please just ask.

The entire process is pure JS and has only been tested on the default template if you changed some parts of the template you may stop this working completely OR stop the session being recorded and so the show/hides don't save between page loads.

Some Screens
---------------------------------------

View attachment 3886 View attachment 3887

Installation
---------------------------------------



Credits
---------------------------------------

The idea for the mod came from Forsaken and I must note that disjunto was a great help in fixing some issues.
By 'help' he means disjunto did all the hard work ;p.
 

Cezz

Well-known member
#13
By 'help' he means disjunto did all the hard work ;p.
Cheeky sod :)... though I must admit that Disjunto was a key factor in its completion..

For example couldn't call the categories ID's directly as li#some-cat.4 because of the number and I had to change this to li[id="some-cat.4"] if it wasn't for Disjunto I would never have worked this out so thank you very much.
 

Shanj

Well-known member
#15
I agree this should be core.

Ceri any idea what sort of template changes would stop this working?
(I have a lot of template changes in mind but they are moving buttons about or changing fonts mostly.)
 

Cezz

Well-known member
#16
I agree this should be core.

Ceri any idea what sort of template changes would stop this working?
(I have a lot of template changes in mind but they are moving buttons about or changing fonts mostly.)
Mostly adding or removing divs around the Node blocks... if it does break it let me know and I may be able to make some changes for you.
 

Cezz

Well-known member
#18
Damn, spent ages coding my own version.
My version as several extra feature like a close all, open all and dynamically knows when everything is open or close..

But your version is so lightweight! Really well done for only a few lines of code :)

Here is a video of the version I'm working on... I need to "trim some fat" before releasing it.
http://dl.dropbox.com/u/695443/themesinc-toggle.mov
Nice version, I did actually have a show/hide all in mind also and I believe it would only take like about 3-4 more lines to add it but then main objective of the code was to be as small as possible.