Display left menu on single CMS page

Hello,
Is it possible to display a left menu on a single CMS page that we created?
 

12 answers

Profile photo of Ziven Staff 100280.00 $tone May 7, 2019
Public

Hi Henrik,
For this expectation, you can follow our UB Mega Menu user guide here (please refer to the Section 2.7 Vertical Menu). 

Is it possible to display a left menu on a single CMS page that we created?

 
Please note you configure the ‘Layout Updates’ settings when creating widgets. 
Step 1: https://prnt.sc/nlcjjs
Step 2: Depending on your specific need, you select the CMS page type accordingly, as shown in this screenshot: http://i.prntscr.com/1NasQ4XySBKawRi0Vcb-QA.png
Hope that helps. 
Best Regards,
Ziven.

#1
Profile photo of henrik 210.00 $tone May 7, 2019
Public

Thank you, but I need to display the module on a specific CMS page not CMS Pages(all)
Is that possible?
Best regards,
Henrik
 

#2
Profile photo of Ziven Staff 100280.00 $tone May 8, 2019
Public

Hi Henrik,

but I need to display the module on a specific CMS page not CMS Pages(all)

I am afraid this will need pretty much customization. 

Below is one option you can consider trying: 
 
Step 1: Go to Admin -> content -> blocks -> add a new block with this declaration:

Block Title: Ub Left Menu
Identifier: ub-left-menu
Content: <div class=”ub-mega-menu-vertical”>{{block class=”Ubertheme\UbMegaMenu\Block\Menu” name=”ub.mega.left.menu” menu_key=”ub-left-menu”}}</div>

(Similar to this screenshot for https://www.dropbox.com/s/ufg0ok3bas6ws7q/2019-05-08_09-35-16.png?dl=0

Step 2: Go to Admin -> content -> pages -> select a CMS page you want -> design: 
and add declaration as follows:

Layout: 2 columns with left bar or 2 columns with right bar
Layout Update XML: 
 
<referenceContainer name=”page.top”>
<block class=”Magento\Cms\Block\Block” name=”ub.left.menu” before=”-“>
<arguments>
<argument name=”block_id” xsi:type=”string”>ub-left-menu</argument>
</arguments>
</block>
</referenceContainer>
<move element=”ub.left.menu” destination=”sidebar.main” before=”-“/>

The declaration above is similar to this screenshot: https://www.dropbox.com/s/8g51qf9w8r7yr6l/2019-05-08_09-31-15.png?dl=0
 
And here’s an example of the result of the left menu: https://www.dropbox.com/s/u8gsfjlsf7kunhl/2019-05-08_09-36-34.png?dl=0
Hope that helps. 

Best Regards,
Ziven.
 

#3
Profile photo of ubdev Staff 98150.00 $tone May 8, 2019
Public

Hi Henrik,
Please discard our previous reply #3, and follow the 2nd workaround below: 

You open a specific CMS page you want to add the left menu, and declare the Layout Update XML similar to this screenshot: http://i.prntscr.com/g6gJj6zwSS_ONd4FRveRFg.png
For your convenience, you can copy the Layout Update XML declaration below:

<referenceContainer name="vertical.ub.mega.menu">
<block class="Ubertheme\UbMegaMenu\Block\Menu" name="main.ub.mega.menu.left" template="Ubertheme_UbMegaMenu::main_menu.phtml" >
<arguments>
<argument name="menu_key" xsi:type="string">main-menu</argument>
<argument name="addition_class" xsi:type="string">ub-mega-menu-vertical</argument>
</arguments>
</block>
</referenceContainer>

Please note:

  • Make sure your CMS page was set with 2 columns layout
  • You already set up Left Menu following our userguide.
  • You replace the menu key’s value with the menu you want to show in your defined CMS page.

Hope that helps.

Regards,
Ubertheme team

#4
Profile photo of ubdev Staff 98150.00 $tone May 8, 2019
Public

Hi Henrik,
Once you can try with the workaround suggested in our reply #4, please let us know how it goes at your end.
Regards,
Ubertheme team 

#6
Profile photo of Ziven Staff 100280.00 $tone May 9, 2019
Public

Hi Henrik,

I got this message in the left menu: “You have not set the menu to show in this store yet.”

I wonder if you did try with our workaround in our reply #3 or #4? Please make sure you replace with correct menu_key value. 

For instance, with the workaround in our #4:

<referenceContainer name=”vertical.ub.mega.menu”>
<block class=”Ubertheme\UbMegaMenu\Block\Menu” name=”main.ub.mega.menu.left” template=”Ubertheme_UbMegaMenu::main_menu.phtml” >
<arguments>
<argument name=”menu_key” xsi:type=”string”>main-menu</argument>
<argument name=”addition_class” xsi:type=”string”>ub-mega-menu-vertical</argument>
</arguments>
</block>
</referenceContainer>

You need to replace the ‘main-menu’ in red with the menu_key value you want to show in the storefront.

In order to get Menu_key value, you navigate to Admin -> Ubertheme’s Extensions -> UbMegaMenu -> Menu Manager (as shown in this screenshot: https://www.dropbox.com/s/m2zdhmv6i751sq0/2019-05-09_08-28-19.png?dl=0

If the issue still persists then, please provide me the admin credentials of your M2 instance, I will check further.
 
PS. Please make sure you mark your reply private, then it’s safe to share your site info here. Only you and our technical team can access. 
Best Regards,
Ziven.

#8
Profile photo of Ziven Staff 100280.00 $tone May 9, 2019
Public

Hi Henrik,

I got this message in the left menu: “You have not set the menu to show in this store yet.”

I have checked the Design tab and see you’re using the argument name=”ub-left-menu”. 
Please replace the argument name “ub-left-menu” in red below:

<referenceContainer name=”vertical.ub.mega.menu”>
<block class=”Ubertheme\UbMegaMenu\Block\Menu” name=”main.ub.mega.menu.left” template=”Ubertheme_UbMegaMenu::main_menu.phtml” >
<arguments>
<argument name=”ub-left-menu” xsi:type=”string”>ub-left-menu</argument>
<argument name=”addition_class” xsi:type=”string”>ub-mega-menu-vertical</argument>
</arguments>
</block>
</referenceContainer>

With ‘menu_key’ as follows: 

<referenceContainer name=”vertical.ub.mega.menu”>
<block class=”Ubertheme\UbMegaMenu\Block\Menu” name=”main.ub.mega.menu.left” template=”Ubertheme_UbMegaMenu::main_menu.phtml” >
<arguments>
<argument name=”menu_key” xsi:type=”string”>ub-left-menu</argument>
<argument name=”addition_class” xsi:type=”string”>ub-mega-menu-vertical</argument>
</arguments>
</block>
</referenceContainer>

Once done, please flush your Magento system cache.

Best Regards,
Ziven. 
 

#10
Profile photo of ubdev Staff 98150.00 $tone May 9, 2019
Public

Hi Henrik,
Once you update the menu_key, the left menu should be shown successfully. 
Regards,
Ubertheme team

#12

Please login or Register to Submit Answer

Written By

Comments