คำถามติดแท็ก containers

2
ย้ายบล็อกไปยังคอนเทนเนอร์อื่นได้อย่างไร
เป็น Newby ฉันมองหาวิธีแก้ปัญหาที่จะย้ายเข้าสู่ระบบและร้านสลับจากไปheader.panel header.containerฉันเพิ่งลองรหัสนี้ แต่ใช้ไม่ได้ <referenceContainer name="header.container"> <referenceBlock class="Magento\Store\Block\Switcher" name="store.settings.language" template="switch/languages.phtml"> </referenceBlock> </referenceContainer>

1
Magento 2: วิธีเพิ่มข้อความภายในคอนเทนเนอร์ผ่าน XML
ฉันพยายามแสดงข้อความบรรทัดเดียวก่อนรายการลิงก์ในส่วนท้าย การสร้างไฟล์เทมเพลตเพื่อทำสิ่งนี้ดูเหมือนจะเป็นการสิ้นเปลืองทรัพยากรสำหรับงานนี้ ตามที่ฉันเข้าใจฉันสามารถส่งออกข้อความด้วยMagento\Framework\View\Element\Textบล็อกในเค้าโครง XML <referenceContainer name="footer"> <container name="footer.column.about_us" htmlTag="div" htmlClass="column about-us" before="-"> <container name="column.about_us.label" htmlTag="div" htmlClass="label"> <block class="Magento\Framework\View\Element\Text" name="about_us.label"> <arguments> <argument name="data" xsi:type="array"> <item name="text" xsi:type="string">About Us</item> </argument> </arguments> </block> </container> <block class="Magento\Framework\View\Element\Html\Links" name="footer_links.about_us"> <arguments> <argument name="css_class" xsi:type="string">footer links</argument> </arguments> </block> </container> </referenceContainer> ก่อนหน้านี้จะไม่แสดงผลใด ๆ และฉันไม่แน่ใจว่าสิ่งนี้จะได้รับการสนับสนุนหรือไม่หากฉันเพิ่งทำผิดหรือมีวิธีการอื่นที่เหมาะสมกว่าในการทำสิ่งนี้ให้สำเร็จ เพื่อให้ชัดเจนสิ่งที่ฉันเห็นอยู่ในขณะนี้คือ: <div class="column about-us"> …
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.