如何在Blogger中创建全局<b:includable>?

时间:2018-03-14 17:40:41

标签: xml blogger

我想知道如何在Blogger模板中添加<b:includable><b:widget>之外的<b:section>

3 个答案:

答案 0 :(得分:0)

  

如果您有一段所需的代码,则包含最有用   在几个不同的地方重复使用,或仅包含在某些地方   情况。

     

要执行此操作,请将内容写入wmic path Win32_VideoController get CurrentHorizontalResolution | FINDSTR [0-9] > X.txt 'Output in a file wmic path Win32_VideoController get CurrentVerticalResolution | FINDSTR [0-9] > Y.txt wmic path Win32_VideoController get CurrentRefreshRate | FINDSTR [0-9] > Hz.txt wmic path Win32_VideoController get CurrentBitsPerPixel | FINDSTR [0-9] > Bits.txt set /p X= < X.txt 'Input from a file set /p Y= < Y.txt set /p Hz= < Hz.txt set /p Bits= < Bits.txt set X=%X: =% 'Remove the spaces set Y=%Y: =% set Hz=%Hz: =% set Bits=%Bits: =% DEL /q X.txt 'Delete file created DEL /q Y.txt DEL /q Hz.txt DEL /q Bits.txt ,然后使用   b:includable,无论您希望它出现在哪里。

来源:Widget Tags for Layouts

答案 1 :(得分:0)

你好兄弟使用这个网址.. https://bloggercode-blogconnexion.blogspot.com.eg/2017/05/tag-b-defaultmarkups.html (Abdelnaem Atia)

答案 2 :(得分:0)

基于Abdelnaem Atia的回答中分享的链接。

首先,您需要在模板中定义b:includable(最好位于<head>区域内) -

<b:defaultmarkups>
    <b:defaultmarkup type='Common'>
        <b:includable id='TestContent'>
            Content I am including
        </b:includable>
    </b:defaultmarkup>
</b:defaultmarkups>

类型设置为Common,以便可以从模板中的任何位置引用它。现在,您只需使用b:include -

进行参考
<b:include name='TestContent' />

您可以在公共类型b:includable标记中创建所需数量b:defaultmarkup -

<b:defaultmarkups>
    <b:defaultmarkup type='Common'>
        <b:includable id='TestContent'>
            Content I am including
        </b:includable>
        <b:includable id='MoreContent'>
            More Content I am including
        </b:includable>
    </b:defaultmarkup>
</b:defaultmarkups>

此功能是在Blogger中的v3模板引擎(https://blogger.googleblog.com/2017/03/share-your-unique-style-with-new.html)中引入的,但现在也适用于较旧的v2模板