Make a menu item invisible?

Ask your questions here.
techtr
Posts: 176
Joined: 23 Nov 2021, 04:48
Name: Zach S.
Location: United States

Make a menu item invisible?

Post by techtr »

Hi everyone, using CSS or any other method, has anyone been able to make a menu item invisible without changing the user rights? I need this to use an info page as a landing page only without it being visible on the menu. I tried several options using the app settings, menu structure, menu configuration, the only for a menu item not to be visible to the user is to remove their rights. I need them to have the rights but not see it on the menu (except for the admin).

Any ideas? Thank you.
Didou12
Posts: 487
Joined: 14 Jan 2023, 14:53
Name: Louis
Location: Montreal, Canada

Re: Make a menu item invisible?

Post by Didou12 »

Yes

viewtopic.php?t=4502
To hide entity you don't want to show (like an entity you already have in a report, like Kanban)
So you want it hidden but not for admin ?
Can you give me the info from tag in the menu (from page source code).
Using Rukovoditel since 2022 --- v3.4 (with extension) in French on PHP 8.2
I keep the French translation up to date
I'm trying to help you (+10 years experience in html, css, php, sql, JS/jquery, python)
techtr
Posts: 176
Joined: 23 Nov 2021, 04:48
Name: Zach S.
Location: United States

Re: Make a menu item invisible?

Post by techtr »

Yes, I want it hidden but not for admin.

I just sent you a private message with the code, I hope that is the right one.

Thank you very much.
Didou12
Posts: 487
Joined: 14 Jan 2023, 14:53
Name: Louis
Location: Montreal, Canada

Re: Make a menu item invisible?

Post by Didou12 »

Perfect, in your case :
- You can add this JS in Configuration, Custom HTML, Add code before tag </body>.
- Remember JS can be access with source of the page, so don't use confidential or privacy datas
For all users, you need to add code in a tag script "<script>CODE HERE</script>" :

Code: Select all

$('ul.sub-menu a.menu-extipagesview3').hide(); //3 is the id of information page IF in a sub-menu, IF not delete "ul.sub-menu" part
Just for admin, unfortunately, you can't add PHP in custom html.
Maybe you can hide this page in the menu (with custom HTML), and for admin add in Application Structure, Menu configuration, Add menu section with a Url type, and access to admins only.

At this time, I don't know another workaround, sorry.
Perhaps by modifying the php files.
Last edited by Didou12 on 03 Jan 2024, 23:43, edited 1 time in total.
Using Rukovoditel since 2022 --- v3.4 (with extension) in French on PHP 8.2
I keep the French translation up to date
I'm trying to help you (+10 years experience in html, css, php, sql, JS/jquery, python)
techtr
Posts: 176
Joined: 23 Nov 2021, 04:48
Name: Zach S.
Location: United States

Re: Make a menu item invisible?

Post by techtr »

Thank you, but unfortunately this did not work. Here is a screenshot of where I put it. Hope I did it correctly.
Hide menu items.jpg
Also fyi, this is the url of the menu item that I am trying to hide.
...../index.php?module=ext/ipages/view&id=3
If this works, I can try a workaround as you suggested in your post. Thanks again.
nruslan2
Posts: 104
Joined: 03 Apr 2021, 23:37
Name: Ruslan
Location: RF

Re: Make a menu item invisible?

Post by nruslan2 »

why are you use User HTMl, if maybe use User CSS?
Didou12
Posts: 487
Joined: 14 Jan 2023, 14:53
Name: Louis
Location: Montreal, Canada

Re: Make a menu item invisible?

Post by Didou12 »

Nruslan2 : Yes sometimes, but with DOM manipulation in the menu, CSS doesn't work, or maybe you have a workaround ? I tried several options and it doesn't work. Maybe how custom.css is loaded before others css for the menu.


Techtr : it works on my computer, it's JS so be sure to force the refresh of the page or to clean your browser, and tell me
Using Rukovoditel since 2022 --- v3.4 (with extension) in French on PHP 8.2
I keep the French translation up to date
I'm trying to help you (+10 years experience in html, css, php, sql, JS/jquery, python)
techtr
Posts: 176
Joined: 23 Nov 2021, 04:48
Name: Zach S.
Location: United States

Re: Make a menu item invisible?

Post by techtr »

Hi Didou12, I force refreshed pages, cleaned cache, tried on different browsers but unfortunately it is not working. Thank you.
Didou12
Posts: 487
Joined: 14 Jan 2023, 14:53
Name: Louis
Location: Montreal, Canada

Re: Make a menu item invisible?

Post by Didou12 »

Very weird. Can you provide me the source (in text) of the whole sidebar in PM ? (Normally there is a comment before and after the sidebar in the html code). Thanks.
Using Rukovoditel since 2022 --- v3.4 (with extension) in French on PHP 8.2
I keep the French translation up to date
I'm trying to help you (+10 years experience in html, css, php, sql, JS/jquery, python)
techtr
Posts: 176
Joined: 23 Nov 2021, 04:48
Name: Zach S.
Location: United States

Re: Make a menu item invisible?

Post by techtr »

I just did. Thanks again.
Post Reply