Default Expand Media Categories

Default Expand Media Categories 1.1.0

No permission to download

Oblivion Knight

Well-known member
iXanon submitted a new resource:

Default Expand Media Categories - Show expanded categories by default on your Media Gallery

Sorry, building a 'template modification add-on' to release is currently beyond me.. :X3:

For now, you can either edit the template xfmg_category_list_macros directly, or set up your own template modification.


Before:
View attachment 186797


After:
View attachment 186798



I may look at trying to collapse them again by default on mobile devices, but for now this modification expands them on all devices.

Credit to @Dadparvar - his post pointed me in the right direction to accomplish this.

Read more about this resource...
 
Last edited:
Hi,
I seem to be getting this error when this add-on enabled and each time users view the media gallery:

Code:
ErrorException: Template error: Function cutemb_is_mobile is unknown  
src/XF/Template/Templater.php:914
 
Works great. Just wondering if its possible to only expand one level?
I can try and look in to it.

In the meantime, you could edit the template modification to something like this:
Code:
<xf:if is="$xf.mobileDetect && !$xf.mobileDetect.isMobile() && in_array($category.category_id, [X,Y,Z])"> is-active<xf:else />{{ $isActive ? ' is-active' : '' }}</xf:if>
Changing X Y Z with the category id's you want to expand.
 
Top Bottom