0

我在 Blogger 中遇到了 b:if 参数,我不确定如何使用它。如果它是首页,我需要使条件返回 true。我该怎么做?

谢谢

4

1 回答 1

0

<b:if>是一个所谓的小部件标签。在 Blogger 帮助页面中查看小部件标签的完整列表。对于条件的值,您可以使用布局数据标签

对于首页的检测,至少有两种可能:

<b:if cond='data:blog.pageName == ""'>
  <!-- Place markup for the front page and archives here -->
<b:else/>
  <!-- Place markup for posts here -->
</b:if>

选择:

<b:if cond='data:blog.pageType == "item"'>
  <!-- Place markup for the posts here -->
<b:else/>
  <!-- Place markup for front page and archive here -->
</b:if>

看一个为搜索引擎优化定制页面标题的例子。

于 2011-03-19T07:53:16.780 回答