Reputation: 731
Basically I want to do this with blogger's conditional tags. Is it possible?
if blog page type = item page
if a label called 'test' exists
<div class='test'>
else
<div>
/if
/if
Upvotes: 0
Views: 888
Reputation: 187
Depends on what you want to do, and where. So far as I'm aware, data:post elements are only accessible inside the <b:includable id='main'></b:includable>
tags. Here's a little something that should help get you started:
<b:if cond='data:blog.pageType == "item"'>
<b:loop values='data:post.labels' var='label'>
<b:if cond='label.name == "MY LABEL X"'>
<div>LABEL X specific content.</div>
</b:if>
<b:if cond='label.name == "MY LABEL Y"'>
<div>LABEL Y specific content</div>
</b:if>
</b:loop>
</b:if>
At this time, the <b:loop ...>...</b:loop>
method is the only way I know to get access to the individual label names. This is untested code, so you might need to fiddle with it.
Upvotes: 3