【发布时间】:2017-08-14 21:21:36
【问题描述】:
我在前端布局中有这些块:
<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 模板中,我只是添加了一个简单的元条目。
然后我运行 setup:upgrade 和 setup:static-content:deploy en_US es_ES 但该条目不在 head 标签中。 我点击了这些链接,但无法显示元条目。
Atwix - Adding blocks to the head section in Magento 2
add-block-in-head-tag-in-magento-2
有什么帮助吗?缺少什么?
【问题讨论】: