htmlxmlbloggerblogger-dynamic-viewsgoogle-blogger-api

How hide " section " on blogger when no widget inside it


I need help Plz. I wanna hide section on blogger when no widget inside it.. or widget is invisble.. and I use this code.

<b:if cond='data:widgets.notEmpty'>
  <b:section id='box-one'/>
</b:if>

but not work for me .. any one have a solution


Solution

  • You can you this code:

    <b:if cond='(data:widgets count w => w.sectionId == "box-one") > 0'>
      <b:section id='box-one'/>
    </b:if>
    

    where box-one is the section id