Challenge: Create and render a template within a block using layout XML in Magento
Learn to create and render Magento blog detail and sidebar templates using layout XML blocks.
Lesson Content
Now that you know how to create a template and render it with a block... why don’t you try it for yourself for the blog detail view?
On this blog detail view, we’ll eventually display the blog content, but also want to display a sidebar template with a list of other related blog posts. For this task, create two templates: one for the main blog post detail content, and another for the sidebar.
Choose the appropriate names for each template, and create each containing placeholders that just output “Blog detail” and “Blog sidebar” respectively.
Make sure the sidebar template is rendered...
Join the discussion!
Comments
Want to comment on this lesson?
Enroll in this course to leave comments.