Everybody needs this: solution

Hello everyone,

While researching for my site I happen to solve the problem of creating different menus for the functionally similar pages of the same modul. May be some of you have already discovered this, but I wanted to share for the others.

The Problem:

We have events (or other profile based modules) with different categories and we want to have different menus on the event pages in particular categories.

For instance , medical cources and medical congresses and other event types.

I want to have completely different menus on  the view event profile pages of congresses and courses.

Normally we have the view-event-profile page that shows all events and it has a unique menu for all event categories . And we can edit from studio. But this is not enough as I want different menus on congresses and medical courses pages.

Solution:

First create your menu;
Studio >Developer>Navigation> Sets>New set
(select the events module)

Add items
(select the events module)

Studio >Developer>Navigation> Menus > New Menu
select events module

Class name: BxEventsMenuView
Class file: modules/boonex/events/classes/BxEventsMenuView.php

and fill other form entries

Create pages courses or congresses from studio > developer> pages and attach them to events module on the create form. 

Class name: BxEventsPageEntry
Class file: modules/boonex/events/classes/BxEventsPageEntry.php

design your page with the blocks of your choice.

now everything is alright but we didnt yet assign our menu to the page.

when we edit the page in studio there is a submenu field but our menu is not appearing there.

so go to database> sys_objects_page > find your page row there 

enter your menu name in the submenu field.

and .... thats all :)

now we have different menu options in the same type of pages of the same module.

Thats why I love UNA 

💟 👍

PS: LeonidS could you please audit this method? Is everthing correct?

  • 661
  • More
Replies (8)
    • Cem  love your work and what you share.  Could we connect? I would like to implement your URL solution, with htaccess rewrite codes. 

      • Thank you Fine just trying to encourage people :)

        but I have to mention that I am not a professional developer (actually a practising medical doctor).

        My solutions are not developed as UNA apps and custom to our web site instead of being universally useable.
        (Variable names are also not in English this may create an other difficulty.)
        I am afraid that they may be difficult to use in other sites or by other admins.
        All work on a superficial layer over UNA.

        I am usually publishing them here to give inspiration for the professional programmers to develop functionally similar UNA apps.

        But if you want to see the code for SEO friendly URLS PM me and I will send you.
        (there is already a professional app by Msolutions.)

        • Thank you Cem you are a great inspiration, I always read your comments first when looking for a solution to problem. You must be an awesome doctor if you are so good with these solutions. Will PM you.

          • 🙏  thank you, like many other I like to share my knowlodge :)

            • Hello Cem !

              Looks fine except this part: "when we edit the page in studio there is a submenu field but our menu is not appearing there. "

              You may change the submenu in Studio->Navigation area.

              • but how to attach it to the new page there?

                • Set the Style of this menu as "Site Navigation submenu". This option is available via Developer only.

                  • oo here is the trick :)

                    Login or Join to comment.