在类别页面Blogger中标记为标题 [英] Label as header in Category Page Blogger
问题描述
我有一个网站,可以显示包含所有相同标签的帖子。是否有一种方法可以在显示具有相同标签的所有帖子时将标签制作为标题。
例如,在 https://newsotuniverse.blogspot .ca / search / label / astrophysics 有没有办法使标题'Astrophysics'或 https://newsotuniverse.blogspot.ca/search/label/engineering 制作标题'Engineering'?
我想把标签的名称(标题)放在这里:
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;'/>
推荐答案
只需替换 // label header here plz
with < data:blog.searchLabel />
,这个数据标签返回当前过滤标签。
Just replace //label header here plz
with <data:blog.searchLabel/>
, this data Tag returns the current filtered label.
它看起来像这样:
$ b
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>
...
包装
span
仅被设置,以便我们可以将css属性text-transform
设置为大写
,因为我喜欢我的标题大写。
The wrapping
span
is set only so that we can set the css propertytext-transform
tocapitalize
, since I Like my headers capitalized.
这篇关于在类别页面Blogger中标记为标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!