I have a list that builds based on the URL segment. Sometimes there no entries for the segment and need to display "no results". I have tried several varations on this and nothing seems to work.
Any suggestions are greatly appriciated, thanks for looking.
I have tried to take this another direction and am tying to use {if no_parents} … {/if} variable.
However written like this it only shows up when there are results not when there is no results. Here is what my code looks like now
{exp:channel:entries
channel="my_child_channel"
orderby="data_contact_last_name"
sort="asc"
limit="3"
}
{exp:playa:parents
channel="mychannel"
field="my_field"
var_prefix="my_var"
}
{if no_parents} no parent content {/if}
<!-- label -->
{if count == '1'}
<h4 class="f400m"><strong>{child:title}</strong></h4> <!-- The title-->
{/if}
<h4><a href="{my_var:url_title}">{my_var:title}</a></h4>
{/exp:playa:parents}
Earlier I tried this and what Jason suggested i also could not get to work.
{exp:channel:entries
channel="my_channel"
limit="3"
}
{exp:playa:parents
channel="my_parent_channel"
field="field_choice"
require_entry="yes"}
{if no_results} <p>There are no entries available.</p> {/if}
{if count == '1'}
<h4>{child:title}</h4>
{/if}
<h4><a href="{url_title}">{title}</a></h4>
{/exp:playa:parents}
{/exp:channel:entries}
{if my_var:count =='1'}
Code updated below.