如何向标签Blogger博客添加单独的唯一主体类

时间:2018-11-26 01:25:21

标签: blogger

我想自动将Homepage和Post页面的唯一类名称添加到标签。

示例:

在首页上显示dataNames[0] = "Type" dataNames[1] = "GameObjectsCount" //Added a s. Now have 16 chars dataValues[0] = "Scene" dataValues[1] = "5"

在标签“ ONE”上显示<body class='homepage-page'>

在标签“两个”上显示<body class='post-page label-one'>

3 个答案:

答案 0 :(得分:0)

您可以使用b:class标记将类添加到父元素。

不是{:{1}}之后的b:class标记

<body>

注意:<body> <b:class cond='data:view.isHomepage' name='homepage-page'/> On homepage <b:class cond='data:view.isSingleItem and (data:post.labels any (l => l.name == "One"))' name='One'/> On posts pages and label "One" 仅在博客窗口小部件data:post.labels内有效

答案 1 :(得分:0)

<body>
<b:class cond='data:view.isHomepage' name='blog-view-home'/>
<b:class cond='data:view.isPost' name='blog-view-item'/>
<b:class cond='data:view.isPage' name='blog-view-static'/>
<b:class cond='data:view.search.label' name='blog-view-search-label'/>
<b:class cond='data:view.search.query' name='blog-view-search-query'/>
<b:class cond='data:view.search and !data:view.search.label and !data:view.search.query' name='blog-view-search-default'/>
<b:class cond='data:view.isArchive' name='blog-view-archive'/>
<b:class cond='data:view.isError' name='blog-view-error'/>
<b:class cond='data:view.isPreview' name='blog-view-preview'/>

答案 2 :(得分:0)

<body>
<b:attr name='class'
          value='multiitem'
          cond='data:view.isMultipleItems == &quot;true&quot;'/>
<b:attr name='class'
          value='homepage'
          cond='data:view.isHomepage == &quot;true&quot;'/>
<b:attr name='class'
          value='singleitem'
          cond='data:view.isSingleItem == &quot;true&quot;'/>
<b:attr name='class'
          value='static'
          cond='data:view.isStatic == &quot;true&quot;'/>
<b:attr name='class'
          value='archive'
          cond='data:view.isArchive == &quot;true&quot;'/>
<b:attr name='class'
          value='error'
          cond='data:view.isError == &quot;true&quot;'/>
<b:attr name='class'
          value='post'
          cond='data:view.isPost == &quot;true&quot;'/>
<b:attr name='class'
          value='page'
          cond='data:view.isPage == &quot;true&quot;'/>