by
KK » Thu Jun 05, 2025 4:35 pm
@Danielhlas, what @trendoman was suggesting is that you have full control of how a tile displays in the admin-panel - so you may device your own collapsible panel (using your JS/CSS) and then show your contents within it.
For example, following is what I came up with as a quick-n-dirty solution using the JS/CSS that is already present in the admin-panel.
Suppose following is how your tile is defined -
- Code: Select all
<cms:tile name='gallery' label='Add Gallery Item'>
<cms:editable name="galleryitem_name" label="Název" type="text"/>
<cms:editable name="galleryitem_link" label="Link" type="text"/>
<cms:editable name="galleryitem_pc_img" label="PC obrázek" type="image" show_preview='1'/>
</cms:tile>
Add your own presentation logic to make it as follows -
- Code: Select all
<cms:tile name='gallery' label='Add Gallery Item'>
<cms:editable name="galleryitem_name" label="Název" type="text"/>
<cms:editable name="galleryitem_link" label="Link" type="text"/>
<cms:editable name="galleryitem_pc_img" label="PC obrázek" type="image" show_preview='1'/>
<cms:config_list_view>
<cms:field 'k_content' >
<div class="mosaic-list">
<fieldset class="row_fieldset <cms:if "<cms:not k_mosaic_field_dynamic_insertion />">collapsed</cms:if>" <cms:if k_mosaic_field_dynamic_insertion><cms:set my_random_id="<cms:random_name />" 'global' /> id="<cms:show my_random_id />"</cms:if>>
<legend>Gallery Item</legend>
<div class="row" style="<cms:if "<cms:not k_mosaic_field_dynamic_insertion />">display:none</cms:if>">
<div class="cell cell-label col-md-12">
<!-- START MARKUP -->
<a class="img-popup" href="<cms:show galleryitem_pc_img />">
<img src="<cms:show galleryitem_pc_img />" width="150">
</a>
<cms:show galleryitem_name /><br>
(Link: <cms:show galleryitem_link />)
<!-- END MARKUP -->
</div>
</div>
</fieldset>
</div>
<cms:if k_mosaic_field_dynamic_insertion>
<script>
(function(){
$('fieldset#<cms:show my_random_id /> legend').on( "click", $.debounce(function( e ) {
var $heading = $(this).blur().parent();
e.preventDefault();
$heading.toggleClass( "collapsed" ).find('.row').animate({
height: "toggle"
}, 200 );
}, 200, true ));
})();
</script>
</cms:if>
</cms:field>
</cms:config_list_view>
</cms:tile>
Details of what is being done above can be found in the mosaic's original thread (
viewtopic.php?f=5&t=11105) but you don't have to bother with that. For your purpose you only need to change the HTML between <!-- START MARKUP --> and <!-- END MARKUP -->. Rest is boilerplate code.
Make sure to visit your modified template on the frontend as super-admin for the changes to persist.
The result should look something like this where each tile shows up in a collapsed state -

- Screenshot from 2025-06-05 16-32-02.png (10.72 KiB) Viewed 1606 times
and can be expanded individually -

- Screenshot from 2025-06-05 16-32-18.png (21.24 KiB) Viewed 1606 times
Hope this helps.
Let me know.