[Addon] Show Hide Node Blocks

Status
Not open for further replies.

Cezz

OMG Member
Joined
Sep 24, 2010
Messages
581
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.
 

Attachments

  • showhideNodes.zip
    23.2 KB · Views: 42

Cezz

OMG Member
Joined
Sep 24, 2010
Messages
581
Thanks for taking the time to work this out and share it with us at xenfans.com :)

It was my pleasure... it was actually fun to build to be honest as I haven't played with JS for a while and this is build with 100% unobtrusive JS...

If anyone wants to make suggestions that will make this more manageable please let me know.

Ceri
 

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
Great work, installed it on this web site (as a test). Since we're not that big, I don't think we really need it. But you can bet ya horse I will install it once we converted wetalknation.net.
 

Miko

OMG Member
Joined
Oct 19, 2010
Messages
108
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.
Hey Cezz,

I forgot to post this on XenForo.com... I have found a bug in your script.

I have made a screencast to show you how to reproduce it.
http://dl.dropbox.com/u/695443/node_hide_bug.mov

I hope it helps

take care,
Miko
 

Kristopher

OMG Member
Joined
Oct 20, 2010
Messages
4
Wow, I even got this to work...So...newbie here, any idea how to default the top category expanded with the rest collapse?
 

Miko

OMG Member
Joined
Oct 19, 2010
Messages
108
How did you create this? I am unable to duplicate.

If you clear your cookies are you able to duplicate it again?

Hey,
Yes, I just test it from an iPad that never visited xenfans before and I was able to reproduce it.

Try this.

Close all nodes starting from the bottom,
Open the middle one, close it, open the top nodes
Do a refresh of the page.

I think that is what i just did with safari mobile
 

Mikey

:mikey:
Staff member
Joined
Jan 26, 2008
Messages
17,836
I can reproduce. I close all forums, open the second one down, click the forums tab in the navbar, and the top one is expanded and the rest collapsed. I cannot show a screencast though, due to some sensitive forums I have access to.
 

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
I can reproduce. I close all forums, open the second one down, click the forums tab in the navbar, and the top one is expanded and the rest collapsed. I cannot show a screencast though, due to some sensitive forums I have access to.
They're very ticklish indeed ^_^
 

Cezz

OMG Member
Joined
Sep 24, 2010
Messages
581
Strange, I have been able to reproduce now, will look into this shortly.

Thank you for bringing this up.

---------

I think I have found the bug, some stupid coding on my part.
 

Cezz

OMG Member
Joined
Sep 24, 2010
Messages
581
First Post Updated with the newest version that fixes two issues... Please uninstall the current one before reinstalling the new one, doing an upgrade doesn't seem to overwrite everything.
 

Weiyan

OMG Member
Joined
Nov 22, 2010
Messages
60
Installed. Very usable for my large site.
Flexile also ok. Flexile should be installed as a child theme of default.
I have a question, can I set default to close?
 

Cezz

OMG Member
Joined
Sep 24, 2010
Messages
581
Installed. Very usable for my large site.
Flexile also ok. Flexile should be installed as a child theme of default.
I have a question, can I set default to close?

Not at present though I am considering making some options for certain forums to be defaulted to closed.
 

Weiyan

OMG Member
Joined
Nov 22, 2010
Messages
60
Thank you.
The triangle icon is same as the quick netvigation icon. If change to "+""-" is easier to understand.
 

Cezz

OMG Member
Joined
Sep 24, 2010
Messages
581
Thank you.
The triangle icon is same as the quick netvigation icon. If change to "+""-" is easier to understand.

This was done because the images are already going to be on any xenforo board, you can change them or remove them (and just show the text) completely in the CSS part if you wish.
 
Status
Not open for further replies.
Top