I've had this added into my theme framework for some time - let me grab the code and will post back.Bump! Any help is greatly appreciated, even if the answer is that it isn't possible.
I'd appreciate that, thank you @whitesky !!I've had this added into my theme framework for some time - let me grab the code and will post back.
<xf:js>
$(".categoryList-toggler, .toggleTarget").each(function() {
$(this).addClass("is-active");
});
</xf:js>
<xf:if is="property('myCategoryToggleProperty')">
<xf:js>
$(".categoryList-toggler, .toggleTarget").each(function() {
$(this).addClass("is-active");
});
</xf:js>
</xf:if>
I'll give it a try in the morning and let you know, thank you for helping me!Doing this with Jquery, so less customized templates to have to maintain
Add this to to either PAGE_CONTAINER template before the closing </head> tag, or to the bottom of helper_js_global before the closing </xf:macro> tag to have it show up everywhere (Resource category lists, etc):
Code:<xf:js> $(".categoryList-toggler, .toggleTarget").each(function() { $(this).addClass("is-active"); }); </xf:js>
If you want it to auto-expand XFMG category lists only, you could add it to xfmg_media_index and xfmg_category_container.
You can also create a custom Style Property to control whether the groups start expanded or not. To do so, enable designer mode and create a custom value/boolean Style Property, say in XFMG: Appearance. After creating the property, change the code earlier to the following:
Code:<xf:if is="property('myCategoryToggleProperty')"> <xf:js> $(".categoryList-toggler, .toggleTarget").each(function() { $(this).addClass("is-active"); }); </xf:js> </xf:if>
Then just change the name of the property above (myCategoryToggleProperty) to the one you created.
Let me know if this works for you!
No problem!I'll give it a try in the morning and let you know, thank you for helping me!
That worked! I really appreciate your help, I'm going to go check out the resources you have out there and see if anything is of interest to purchase. Great community we have here!No problem!
Sorry for another question, but when I click a media category or sub category all of the categories minimize again. When I just got to the media gallery it works as I had hoped. Is there a way to keep them always expanded even when in a category or sub category? I used the first code you posted into xfmg_media_index and xfmg_category_container , if that helps.No problem!
Is there a way to keep them always expanded even when in a category or sub category?
xfmg_category_list_macros
:<ol class="categoryList toggleTarget{{ $isActive ? ' is-active' : '' }}">
<ol class="categoryList toggleTarget is-active">
<a class="categoryList-toggler{{ $isActive ? ' is-active' : '' }}"
<a class="categoryList-toggler is-active"
I appreciate it it, that worked, thank you very much!There is also another approach by editing the template (or use Template modifications).
Inxfmg_category_list_macros
:
FIND:
<ol class="categoryList toggleTarget{{ $isActive ? ' is-active' : '' }}">
REPLACE:
<ol class="categoryList toggleTarget is-active">
---
FIND:
<a class="categoryList-toggler{{ $isActive ? ' is-active' : '' }}"
REPLACE:
<a class="categoryList-toggler is-active"
We use essential cookies to make this site work, and optional cookies to enhance your experience.