J4 sidebar menu Topic is solved

Be informed that this forum is not an official support forum for Joomla! 4.0. Any issues regarding Joomla! 4.0 must be reported at https://issues.joomla.org/.

Joomla 4.0 is still in Beta stage. This forum should be used for sharing information about Joomla! 4.0.
Post Reply
fgonc124
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Tue Feb 09, 2016 2:17 pm

J4 sidebar menu

Post by fgonc124 » Mon Nov 30, 2020 4:44 pm

Hi

How can we add a sidebar menu on J4?

I tried to use JHtmlSidebar::addEntry but nothing happens.

Can anyone help me?

Thanks

User avatar
AMurray
Joomla! Champion
Joomla! Champion
Posts: 6367
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: J4 sidebar menu

Post by AMurray » Mon Nov 30, 2020 9:57 pm

I'm not sure what exactly you want to achieve but do you mean a left vertical module position in a front-end template?

If the template has a "left" position, then just assign menu module to that position?

You should be able to amend the template (Cassiopeia?) layout and add any module position you want.
I don't know if these instructions are still relevant to J4 templates but it walks you through the process of how to build a template (including defining the module positions) https://docs.joomla.org/Creating_a_basi ... !_template. It could help with any amendments to an existing template.

J4 administrator template already has a "sidebar menu".......

Do you mean an "off canvas" module position....(front-end template)?

Otherwise can you elaborate on what you're trying to achieve.

Be aware of course, J4 is still in Beta, not final stable release. Any changes you do to any core elements (including templates) will be overwritten if you update the test system to any future beta or RC's. Better to work on a copy of the template.
Regards,
--------------------------------------------------------------
A Murray
Help you I can, yes!. Post your question, you should. Keep it on topic you must!
Use the Forc....Forum Post Assistant my young Padawan!

fgonc124
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Tue Feb 09, 2016 2:17 pm

Re: J4 sidebar menu

Post by fgonc124 » Tue Dec 01, 2020 9:42 am

Thanks for your answer.

I want to add submenu to left sidebar on the admin template.

I dont understand the use of Jhtmlsidebar api in J4 since we already have a sidebar.

I see components adding submenus in admin template but cant figure out how it is done.

Thanks

User avatar
ceford
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 157
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: J4 sidebar menu

Post by ceford » Tue Dec 01, 2020 4:41 pm

Separate sidebar menus are not used in Joomla 4. If you mean the list of sub-menu items seen when a main menu opens - just look at administrator/com_banners/banners.xml to see how its sub-menu items are specified.

fgonc124
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Tue Feb 09, 2016 2:17 pm

Re: J4 sidebar menu

Post by fgonc124 » Wed Dec 02, 2020 10:45 am

ceford. Thanks for your answer

This is what i'm looking for.

Does Jhtmlsidebar works in J4?

Thanks

User avatar
ceford
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 157
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: J4 sidebar menu

Post by ceford » Wed Dec 02, 2020 3:41 pm

fgonc124 wrote:
Wed Dec 02, 2020 10:45 am
This is what i'm looking for.

Does Jhtmlsidebar works in J4?
It is referred to in a couple of places here:

https://docs.joomla.org/Potential_backw ... n_Joomla_4

libraries/src/HTML/Helpers/Sidebar.php is present in the code. Does it work? You will soon be able to tell us.


Post Reply

Return to “Joomla! 4 Related”