Hello All,
I’ve run into an issue and I am hoping someone out there might have a solution to my problem.
Here is the situation:
I have a “table” that has some product information - including two download sections. Not every product will have files in each section (though that might change) so I need to find a way to dynamically show and hide the containing div based on whether or not there is content.
Here is the code I am working with:
{exp:channel:entries dynamic="no" entry_id="0{embed:entry_ids}" sort="asc"}
{if no_results}
<h2>No Entries</h2>
<p> {/if}<br />
<li class="product-details group"><br />
<div class="text-container"><br />
</p><h5>{title}</h5>
<p> {product_description}<br />
</div><!-- eo text-container --><br />
{product_image}<br />
<div class="referencebox request-quote-container group"><br />
<ul class="blanklist"><br />
{offline_product_documentation}<br />
<li class="{switch='odd|even'}"><br />
<a href="http://{offline_file_upload}">{product_number}</a><br />
</li><br />
{/offline_product_documentation}<br />
</ul> <br />
<div class="coa"><br />
<a href="http://{path=">Request A Quote »</a><br />
</div><!-- eo coa --><br />
</div><!-- eo reference box / request quote --><br />
<div class="referencebox available-online-container group"><br />
<ul class="blanklist"><br />
{online_product_documentation}<br />
<li class="{switch='odd|even'}"><br />
<a href="http://{online_file_upload}">{online_product_number}</a><br />
</li><br />
{/online_product_documentation}<br />
</ul> <br />
<div class="coa"><br />
<a href="http://{path=">Available Online »</a><br />
</div><!-- eo coa --><br />
</div><!-- eo reference box / available online --><br />
</li><br />
{/exp:channel:entries}All of this is being pulled in through reverse_related_entries.
A working example would be that
<div class="referencebox available-online-container group"><a href="http://{online_file_upload}">{online_product_number}</a>.
In short, does anyone know of a way to show or hide a div - and it’s contents, based on whether or not there is content present for a specific channel entry field that occurs within it?
Please let me know if I can clarify anything or provide more information.
Thanks!
Nathan