Collapsible categories without images

For support and discussion related to templates, themes, and imagesets in phpBB 3.0.
Get Involved
Locked
AwesomeStyle
Registered User
Posts: 64
Joined: Tue Jul 16, 2013 7:10 pm

Collapsible categories without images

Post by AwesomeStyle »

Hello, me again :)

As I am working on eMuza style mod, I would like to implement collapsible categories.
What I need are buttons for collapsing with '+' and '-' but not images.

EDIT: Sorry, wrong forum..... So stupid LOL

Thanks, AwesomeStyle.
I will install MODs for your forum as cheap as 5-15$ in BitCoin depending on the MOD install level & time. Contact via PM.

User avatar
Abhishek Srivastava
Registered User
Posts: 191
Joined: Mon Jul 01, 2013 12:48 pm
Location: India
Name: Abhishek
Contact:

Re: Collapsible categories without images

Post by Abhishek Srivastava »

What do you mean by buttons and not images?

Are you talking about buttons like we have a "Submit" button in quick reply? If yes, then just use the button css instead of background-image and all that, and code "+" and "-" in buttons. (If i am wrong please correct me)
Follow me on twitter @Abh1shekS
Follow me on facebook Abhishek Srivastava
My LinkedIn: abhi5hek

AwesomeStyle
Registered User
Posts: 64
Joined: Tue Jul 16, 2013 7:10 pm

Re: Collapsible categories without images

Post by AwesomeStyle »

Abhishek Srivastava wrote:What do you mean by buttons and not images?

Are you talking about buttons like we have a "Submit" button in quick reply? If yes, then just use the button css instead of background-image and all that, and code "+" and "-" in buttons. (If i am wrong please correct me)
I am talking about this, but it is using images for buttons and I just want to use textual buttons with '+' and '-' replacing images.
I will install MODs for your forum as cheap as 5-15$ in BitCoin depending on the MOD install level & time. Contact via PM.

User avatar
Abhishek Srivastava
Registered User
Posts: 191
Joined: Mon Jul 01, 2013 12:48 pm
Location: India
Name: Abhishek
Contact:

Re: Collapsible categories without images

Post by Abhishek Srivastava »

Trying asking at Christian's website. He might help you. :)
Follow me on twitter @Abh1shekS
Follow me on facebook Abhishek Srivastava
My LinkedIn: abhi5hek

AwesomeStyle
Registered User
Posts: 64
Joined: Tue Jul 16, 2013 7:10 pm

Re: Collapsible categories without images

Post by AwesomeStyle »

Okay :)

Thanks,
AwesomeStyle.
I will install MODs for your forum as cheap as 5-15$ in BitCoin depending on the MOD install level & time. Contact via PM.

User avatar
Christian 2.0
Former Team Member
Posts: 4551
Joined: Wed Nov 04, 2009 11:16 pm
Location: UK
Name: Christian
Contact:

Re: Collapsible categories without images

Post by Christian 2.0 »

Hmm. It's not really possible to do this given the complex nature of the jQuery code used to collapse the categories.

User avatar
DionDesigns
Registered User
Posts: 515
Joined: Sun Feb 26, 2012 11:22 pm
Location: Uncertain due to momentum.
Contact:

Re: Collapsible categories without images

Post by DionDesigns »

Christian 2.0 wrote:Hmm. It's not really possible to do this given the complex nature of the jQuery code used to collapse the categories.
Seems to me that in the JS added to forumlist_body.html, if one added:

Code: Select all

$(this).find('.trigger').innerHTML = '-';
to the "show" block, and:

Code: Select all

$(this).find('.trigger').innerHTML = '+';
to the "hide" block, made some minor changes to the .trigger CSS rule (add background, color, line-height properties), and added a default - inside <div class="trigger"></div>, one would be very close to replacing the background image with +/- characters.

I'd personally use CSS transitions for the animation, document.cookie to update the (JSON) cookie when a +/- button is clicked, and reading the (JSON) cookie in functions_display.php and creating a {forumrow.COLL_EXP} template variable to set the default category positions. One would also need a {CE_COOKIE} template variable containing the entire cookie to be able to update the cookie. IE7/8/9 wouldn't see animation, though expand/collapse would still work. This would eliminate the overhead and sluggishness of using jQuery add-ons.

User avatar
Christian 2.0
Former Team Member
Posts: 4551
Joined: Wed Nov 04, 2009 11:16 pm
Location: UK
Name: Christian
Contact:

Re: Collapsible categories without images

Post by Christian 2.0 »

DionDesigns wrote:This would eliminate the overhead and sluggishness of using jQuery add-ons.
On the basis we're in 2013, average home broadband is 30mb/s and average 3G is around 4mb/s , I'm not going to lose too much sleep over fractions of a second. ;)

User avatar
DionDesigns
Registered User
Posts: 515
Joined: Sun Feb 26, 2012 11:22 pm
Location: Uncertain due to momentum.
Contact:

Re: Collapsible categories without images

Post by DionDesigns »

I agree you shouldn't be losing sleep due to download speeds.

You should be losing sleep due to the JS causing browser sluggishness on the page, for a feature that will be used once and then likely never used again. ;)

Hence my comment about using CSS transitions if I ever had the need for a collapsible-category feature. However, if a client's site was already loading jQuery, I'd probably use $.slideToggle() since it does the animation with no additional JS overhead, and it's compatible with IE7/8/9.

But that wasn't the point of my post. It's pretty easy to modify the code in your article to support text-based buttons (which is what the OP wanted), and I suggested how to approach the task.

AwesomeStyle
Registered User
Posts: 64
Joined: Tue Jul 16, 2013 7:10 pm

Re: Collapsible categories without images

Post by AwesomeStyle »

How is it done here? http://clanptg.co.uk/
I will install MODs for your forum as cheap as 5-15$ in BitCoin depending on the MOD install level & time. Contact via PM.

User avatar
Abhishek Srivastava
Registered User
Posts: 191
Joined: Mon Jul 01, 2013 12:48 pm
Location: India
Name: Abhishek
Contact:

Re: Collapsible categories without images

Post by Abhishek Srivastava »

That's myBB. Why don't you use a small image similar to it? It would also look like that only. :)
Follow me on twitter @Abh1shekS
Follow me on facebook Abhishek Srivastava
My LinkedIn: abhi5hek

AwesomeStyle
Registered User
Posts: 64
Joined: Tue Jul 16, 2013 7:10 pm

Re: Collapsible categories without images

Post by AwesomeStyle »

Thanks everyone for replying. At the end, I just used Christian's .psd :)

Regards,
AwesomeStyle.
I will install MODs for your forum as cheap as 5-15$ in BitCoin depending on the MOD install level & time. Contact via PM.

Locked

Return to “[3.0.x] Styles Support & Discussion”