2017-05-24 52 views
0

我有这些块在前端布局:添加<referenceBlock名称=“head.additional”> Magento的2不工作

<referenceContainer name="content"> 
     <block class="Dfl\Marketplace\Block\Profile" name="marketplace_sellerprofile" template="profile.phtml" cacheable="false" before="-"/> 
    </referenceContainer> 
    <referenceContainer name="sidebar.main"> 
     <block class="Dfl\Marketplace\Block\Profile" name="marketplace_sellerprofileleft" template="profile_left_sidebar.phtml" cacheable="false" before="-"/> 
    </referenceContainer> 
    <referenceContainer name="sidebar.additional"> 
     <block class="Dfl\Marketplace\Block\Profile" name="marketplace_sellerprofileright" template="profile_right_sidebar.phtml" cacheable="false" before="-"/> 
    </referenceContainer> 

然后我想以将其插入到部分添加新的块。 我添加下面的命令这些块以上

<referenceBlock name="head.additional"> 
     <block class="Dfl\Marketplace\Block\Profile" name="marketplace_social_tags" template="social_tags.phtml" /> 
    </referenceBlock> 

然后在我的social_tags.phtml模板我只是增加了一个简单的元条目。

meta entry example

然后我跑设置:upgrad e和设置:静态内容:部署EN_US es_ES 但入口是不存在的头标记。 我跟着这些链接,但我无法显示元条目。

Atwix - Adding blocks to the head section in Magento 2

add-block-in-head-tag-in-magento-2

任何帮助吗?它缺少什么?

回答

0

男人。我在试图让头脑里的东西陷入同样的​​问题。 试了4个小时。

即使一些网站,甚至一个例子模块引用head.additional在default.xml中 - 我发现,我在default_head_blocks.xml使用

<referenceBlock name="head.additional"> 

当它是唯一的工作

这让我如此疯狂。