Re: Display only one label of a group

52 views
Skip to first unread message
Message has been deleted

Rachid Amaoui

unread,
Jan 14, 2020, 9:07:15 AM1/14/20
to Forum Blogger Ambassade Francophone
Hi,
So, what you want is to show only one label for articles that contains A,B,C,D,E or F as label? and to show all of them for others articles.
Is that correct?




Le lundi 13 janvier 2020 12:34:54 UTC+1, Sophia a écrit :
Hi,
I'm trying to set the visualization of a label in home page but I've some problems. What I want is to visualize only one label also for the posts that have more labels. This is the code:

<b:if cond='data:view.isMultipleItems != data:view.isLabelSearch'>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name == &quot;A&quot; or data:label.name == &quot;B&quot; or data:label.name == &quot;C&quot; or data:label.name == &quot;D&quot; or data:label.name == &quot;E&quot; or data:label.name == &quot;F&quot;'>
<span> <a expr:href='data:label.url' rel='tag'><data:'label.name' /></a> </span>
</b:if>
</b:loop>
</b:if>
I tried also this one, but some labels aren't displayed:

<b:if cond='data:view.isMultipleItems != data:view.isLabelSearch'>          
<b:loop values='data:post.labels limit 1' var='label'>
<b:if cond='data:label.name == &quot;A&quot; or data:label.name == &quot;B&quot; or data:label.name == &quot;C&quot; or data:label.name == &quot;D&quot; or data:label.name == &quot;E&quot; or data:label.name == &quot;F&quot;'>
<span> <a expr:href='data:label.url' rel='tag'><data:'label.name' /></a> </span>
</b:if>
</b:loop>
</b:if>

How can I do it?
Thank you very much

Reply all
Reply to author
Forward
Message has been deleted
0 new messages