Advanced content manager extension for Magento®
- a powerful CMS

Add a side navigation to my contents

We want to add a sidebar navigation on the left of the Contents, in a specific ContentType :



In this example, we have a ContentType which has an identifier ‘blog’.


First of all, we need to change the setting of the layout in our ContentType ‘blog’ to “2 columns with left bar”:

The next step is to add a dynamic layout handle for this ContentType:

So we create the following file: CONTENT_TYPE_VIEW_blog in app/design/frontend/‹Vendor›/‹Theme›/Blackbird_ContentManager/layout/CONTENT_TYPE_VIEW_blog.xml

--> For further details about the Dynamic Layout Handle, please go to the corresponding documentation page.


With the following content (if you prefer, you can also directly add it in the field layout update xml in the ContentType page edit):

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <referenceContainer name="sidebar.additional">
        <block class="Blackbird\ContentManager\Block\Content\Widget\ContentList" name="blog-sidebar-navigation-link">
            <action method="setTitle">
                <argument name="title" xsi:type="string">Sidebar Navigation</argument>
            </action>
            <action method="setCtType">
                <argument name="type" xsi:type="string">blog</argument>
            </action>
        </block>
    </referenceContainer>
</layout>

We built our navigation with a ContentList widget block, in order to generate all the link of each content of the current ContentType.
For further details about how to customize your ContentList widget block, please go to the corresponding documentation page.

That’s all folk!

100%
OpenSource

60 days
free support

Unlimited
updates

Made for developers
and webmasters

14 days money
back guarantee

Made by Magento
certified developers