设计主题的Google Blogger XML布局错误

时间:2018-10-21 18:29:09

标签: xml blogger xml-layout

我想使用 Google Blogger XML布局标题区域分为两个部分(否-徽标和否-广告区域)

当我尝试保存XML代码时,Blogger HTML编辑器显示错误-

  

带有id徽标的小部件不在一个部分中(实际的父元素   是:标题。)每个小部件都应在一个部分中

检查“我的XML”代码并检查附件图像以了解更多我想要什么?

<b:section class='header' id='header' maxwidgets='2' showaddelement='yes'>
<div class='container border-1'>
    <header class='row'>
        <b:widget id='logo' locked='true' title='' type='Header'>
            <div class='col-md-4 col-sm-4 col-xs-1 border-1 d-none d-sm-block'> <div id='logo_main_area_device-lg__md__sm' style='background: #fff; max-height:90px !important; height:90px;'> <div id='logo-text_device-lg__md__sm'><a style='text-decoration:none !important; color:#000 !important;' href='//www.jobluto.com'>JobLuto.Com</a></div> </div> </div>
            <div class='col-md-4 col-sm-4 col-xs-1 border-1 d-block d-sm-none'> <div id='logo_main_area_device-xs' style='background: #fff; max-height:50px !important; height:90px;'> <div id='logo-text_device-xs'><a style='text-decoration:none !important; color:#000 !important;' href='//www.jobluto.com'>JobLuto.Com</a></div> </div> </div>
        </b:widget>
        <b:widget id='ads1' locked='true' title='' type='Header'>
            <div class='col-md-8 col-sm-8 col-xs-11 overflow-none border-1' style='background: #777; padding: 0 0.00000001px 0 0.00000001px;'> <img class='img-fluid' style='width:100% !important; height: 90px !important;' src='http://www.creditlenders.info/wp-content/uploads/banner-ad-banner-ads-macallister-design.jpg' alt=''/> </div>
        </b:widget>
    </header>
</div></b:section>

Watch This Image To Understand My Requirment

1 个答案:

答案 0 :(得分:0)

在Blogger中,b:section标签只能包含b:widget标签代表的小部件。另外,要将HTML代码插入小部件内,请使用b:include标签,如下所示:

<b:widget id='logo'>
  <b:includable id='main' var='this'>
     Your HTML code here
  </b:includable>
</b:widget>

您的代码应为(在节中的类名称行

<div class='container border-1'>
    <b:section class='header row' id='header' maxwidgets='2' showaddelement='yes'>
        <b:widget id='logo' locked='true' title='' type='Header'>
            <b:includable id='main' var='this'>
                <div class='col-md-4 col-sm-4 col-xs-1 border-1 d-none d-sm-block'> <div id='logo_main_area_device-lg__md__sm' style='background: #fff; max-height:90px !important; height:90px;'> <div id='logo-text_device-lg__md__sm'><a style='text-decoration:none !important; color:#000 !important;' href='//www.jobluto.com'>JobLuto.Com</a></div> </div> </div>
                    <div class='col-md-4 col-sm-4 col-xs-1 border-1 d-block d-sm-none'> <div id='logo_main_area_device-xs' style='background: #fff; max-height:50px !important; height:90px;'> <div id='logo-text_device-xs'><a style='text-decoration:none !important; color:#000 !important;' href='//www.jobluto.com'>JobLuto.Com</a></div> </div> </div>
            </b:includable>
        </b:widget>
        <b:widget id='ads1' locked='true' title='' type='Header'>
          <b:includable id='main' var='this'>
            <div class='col-md-8 col-sm-8 col-xs-11 overflow-none border-1' style='background: #777; padding: 0 0.00000001px 0 0.00000001px;'> <img class='img-fluid' style='width:100% !important; height: 90px !important;' src='http://www.creditlenders.info/wp-content/uploads/banner-ad-banner-ads-macallister-design.jpg' alt=''/> </div>
          </b:includable>
        </b:widget>
    </b:section>
</div>