Goodmorning,
I'm working on a project with Couchcms and I'm facing a problem of which I can't find a solution anywhere, even reading documentation and other troubleshootings.
I have a repeatable region, but I want the div containing the fields to be visible only if there is more than one repeatable row filfilled (in the back-end). The reason I want to achieve this is that if I don't hide it when empty, it shows the encumbrance of the div, keeping a lot of white space.
I already tried with
And also replacing "k_count" with "k_total_records". Also tried with
... None of them worked for me.
_______________________________________
This is what I have got:
The part which must be hidden is the one starting just after the <cms:show_repeatable 'sezione_box'> opening tag.
If anyone could give me some advice, it would be a great help!
Thanks in advance!
I'm working on a project with Couchcms and I'm facing a problem of which I can't find a solution anywhere, even reading documentation and other troubleshootings.
I have a repeatable region, but I want the div containing the fields to be visible only if there is more than one repeatable row filfilled (in the back-end). The reason I want to achieve this is that if I don't hide it when empty, it shows the encumbrance of the div, keeping a lot of white space.
I already tried with
- Code: Select all
<cms:show_repeatable 'sezione_box'>
<cms:if k_count ge '1'>
...
</cms:if>
</cms:show_repeatable>
And also replacing "k_count" with "k_total_records". Also tried with
- Code: Select all
<cms:if "<cms:show_repeatable 'sezione_box' count_only='1' />">
<div class="row">
<cms:show_repeatable 'sezione_box'>
...
</cms:show_repeatable>
</div>
</cms:if>
... None of them worked for me.
_______________________________________
This is what I have got:
- Code: Select all
<cms:repeatable name='sezione_box' label='Box' group='box'>
<cms:editable type='image' name='box_immagine' label='Immagine di sfondo'/>
<cms:editable type='text' name='box_titolo' label='Titolo del box'/>
<cms:editable type='text' name='box_testo' label='Testo del box'/>
<cms:editable type='text' name='box_link' label='Link del box'/>
</cms:repeatable>
- Code: Select all
<cms:show_repeatable 'sezione_box'>
<div class="col-lg-4 col-md-6">
<div class="content-box-7">
<a href="<cms:show box_link/>" target="_blank">
<div class="content-box-img js-bg js-height square" data-image-src="<cms:show box_immagine/>">
<div class="info">
<h5 class="text-white"><cms:show box_titolo/></h5>
<p class="text-white"><cms:show box_testo/></p>
</div>
</div>
</a>
</div>
</div>
</cms:show_repeatable>
The part which must be hidden is the one starting just after the <cms:show_repeatable 'sezione_box'> opening tag.
If anyone could give me some advice, it would be a great help!
Thanks in advance!