0

enter image description here

i am using following code for display about section i want to hide above section from left navigation when age and cost does not have any value please guide me thank you

 <div class="filter-attribute">
  <h3>Filter By</h3>
</div>
<div class="attirbute-name">
  <h2>Age</h2>
  {exp:channel:entries channel="science_projects" search:age="1-20|21-40|41-60|61-80|81-100" limit="3" dynamic="off" sort="desc"}
  {if age != "Select Age Range"}
  <ul>
    <li><a href="#">{age}</a></li>
  </ul>
  {/if}
  {/exp:channel:entries} </div>
<div class="attirbute-name">
  <h2>Cost</h2>
  {exp:channel:entries channel="science_projects" search:cost="Low|Medium|High" limit="3" dynamic="off" sort="desc"}
  {if cost != "Select Cost Option"}
  <ul>
    <li><a href="#">{cost}</a></li>
  </ul>
  {/if}
  {/exp:channel:entries} </div>
0

Try something like this:

{exp:channel:entries channel="science_projects" search:age="1-20|21-40|41-60|61-80|81-100" limit="3" dynamic="off" sort="desc"}
{if age != "Select Age Range"}
  {if count == "1"}
    <div class="filter-attribute">
    <h3>Filter By</h3>
    </div>
    <div class="attirbute-name">
    <h2>Age</h2>
  {/if}
    <ul>
    <li><a href="#">{age}</a></li>
    </ul>
  {if count == total_results}
    </div>
  {/if}
{/if}
{/exp:channel:entries}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.