Goodmorning everyone,
I'm quite new to Couchcms, and I'm encountering a problem of wich I can't find a solution.
I have a Blog page, which contains blog articles, all handled dynamically with Couchcms. In the sidebar of the Blog article page I have "Related articles" and "Related products" widgets, both handled with <cms:related_pages> tag (I post here only one of the two widgets, as they are basically the same).
Here is what I have at the top of the page
And here is what I have in the widget area
What I'm trying to achieve is to hide the entire widget section if there are no related articles checked in backend (basically if there are no related articles, the title is still showing, but with no content, which is not quite good). I tried to wrap the entire widget with a <cms:if prodotti_correlati> tag, but instead of hiding only the empty widgets, it hides also the sections where the related articles are checked.
I hope I well explained the problem, as I'm not really into Couchcms programming.
Thanks everyone!
I'm quite new to Couchcms, and I'm encountering a problem of wich I can't find a solution.
I have a Blog page, which contains blog articles, all handled dynamically with Couchcms. In the sidebar of the Blog article page I have "Related articles" and "Related products" widgets, both handled with <cms:related_pages> tag (I post here only one of the two widgets, as they are basically the same).
Here is what I have at the top of the page
- Code: Select all
<cms:editable name="articoli_correlati" label="Articoli correlati" type='relation' masterpage='blog.php' />
<cms:editable name="prodotti_correlati" label="Prodotti correlati" type='relation' masterpage='prodotti.php' />
And here is what I have in the widget area
- Code: Select all
<div class="recent-post-widget">
<div class="widget-heading">
<h3>Related articles</h3>
</div>
<div class="widget-content">
<cms:related_pages 'articoli_correlati' limit='4'>
<div class="recent-post-item">
<div class="recent-post-item-image">
<img src="<cms:show foto_articolo/>" alt="<cms:show k_page_title/>" />
</div>
<div class="recent-post-item-content">
<div class="recent-post-item-title">
<a href="<cms:show k_page_link/>"><cms:show k_page_title/></a>
</div>
<div class="recent-post-item-date">
<p><cms:date k_page_date format='%e/%m/%Y' locale='italian'/></p>
</div>
</div>
</div>
</cms:related_pages>
</div>
</div>
What I'm trying to achieve is to hide the entire widget section if there are no related articles checked in backend (basically if there are no related articles, the title is still showing, but with no content, which is not quite good). I tried to wrap the entire widget with a <cms:if prodotti_correlati> tag, but instead of hiding only the empty widgets, it hides also the sections where the related articles are checked.
I hope I well explained the problem, as I'm not really into Couchcms programming.
Thanks everyone!
