selcukctn
selcukctn

Reputation: 255

How can search labels in blogger post? with b:if?

I get an error when I use if else this way. My goal is to check if there is a value I want in the label.

<b:loop index='i' values='data:posts' var='post'>
  <b:if cond='data:post.labels in {"referans"}'>
    <b:include data='post' name='postCommentsAndAd'/>
  </b:if>
</b:loop>

Upvotes: 0

Views: 175

Answers (1)

selcukctn
selcukctn

Reputation: 255

this code worked.

<b:loop index='i' values='data:posts' var='post'>
                    <b:if cond='data:post.labels any (label => label.name == "referans")'>
                        <b:include data='post' name='postCommentsAndAd'/>
                    </b:if>
                  </b:loop>

Upvotes: 0

Related Questions