Reputation: 47
I have a website in which I can show posts with all the same labels. Is there a way to make the label as the header when showing all the posts with the same label.
For example, on https://newsotuniverse.blogspot.ca/search/label/astrophysics is there a way to make the header 'Astrophysics' or on https://newsotuniverse.blogspot.ca/search/label/engineering to make the header 'Engineering'?
I would like to put the name of the label (the header) in this:
<b:if cond='data:navMessage'>
<div class='status-msg-wrap'>
<div class='status-msg-body'>
<data:label.url/>
//label header here plz
</div>
<div class='status-msg-border'>
<div class='status-msg-bg'>
<div class='status-msg-hidden'><data:navMessage/></div>
</div>
</div>
</div>
<div style='clear: both;'/>
Upvotes: 1
Views: 304
Reputation: 14730
Just replace //label header here plz
with <data:blog.searchLabel/>
, this data Tag returns the current filtered label.
It cloud look, like this:
...
<div class='status-msg-wrap'>
<div class='status-msg-body'>
...
<span style="text-transform: capitalize;"><data:blog.searchLabel/></span>
...
</div>
<div class='status-msg-border'>
<div class='status-msg-bg'>
<div class='status-msg-hidden'><data:navMessage/></div>
</div>
</div>
...
The wrapping
span
is set only so that we can set the css propertytext-transform
tocapitalize
, since I Like my headers capitalized.
Upvotes: 1