Remove Dashboard link in Navbar Usermenu Boost

Re: [SOLVED] Re: Remove Dashboard link in Navbar Usermenu Boost

by Mary Evans -
Number of replies: 6
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Are you asking a question or did you solve it after asking the question?

Anyway here is an image of where you need to add the SCSS.

(this is Boost theme that I am altering on my Moodle Cloud site... Hope it helps?

Cheers

Mary

https://bylazydaisy.moodlecloud.com

Raw SCSS Boost theme

In reply to Mary Evans

Re: [SOLVED] Re: Remove Dashboard link in Navbar Usermenu Boost

by Malcolm Woodman -

Sorry, coming to this thread late, but have just tried to use this code. It does indeed remove the "dashboard" item from the user menu, but it also removes the "edit settings" item from the "edit" menu on activities and resources (and possibly the first option from other menus that I haven't found yet). Any suggestions on how to make it more specific? Thanks

In reply to Malcolm Woodman

Re: [SOLVED] Re: Remove Dashboard link in Navbar Usermenu Boost

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

To target a specific page you need to view the page source to find the body ID.

For example, tge dashboard Page ID is as follows...

#page-my-index

So adding that in front of the CSS you added will only affect the Dashboard menu.

The ID for the Site Home page, or Frontpage as we call it, is as follows...

#page-site-index

Hope this helps?

Mary

In reply to Malcolm Woodman

Re: [SOLVED] Re: Remove Dashboard link in Navbar Usermenu Boost

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

.usermenu a.dropdown-item.menu-action:first-child {display: none;}
Using the class usermenu to target it should restrict the css to only the usermenu and as "dashboard" is the first item the first-child should target that in the menu.

Nadav's original suggestion was targetting the first-child in any dropdown-menu class, including the "edit settings"


Hope that helps.

Average of ratings: Useful (1)
In reply to Richard Oelmann

Re: [SOLVED] Re: Remove Dashboard link in Navbar Usermenu Boost

by Malcolm Woodman -

Thanks for both responses.

adding .usermenu to the start of the CSS worked perfectly. Adding #page-site-index still removed the first-child from the activities we have on the front page as well as the usermenu. However, being new to all this, it has also been a very useful learning exercise, as I now understand much better how the CSS works!

Thanks again

In reply to Malcolm Woodman

Re: [SOLVED] Re: Remove Dashboard link in Navbar Usermenu Boost

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

At least you got it working with Richards code. I had assumed you were using the code that this discussion is about?

However, adding the code I posted infront of the one Richard posted should work just as well If you just wanted to target a specific page.

In reply to Mary Evans

Re: [SOLVED] Re: Remove Dashboard link in Navbar Usermenu Boost

by Malcolm Woodman -

Thanks Mary, that's really useful. 

I hadn't realised I could combine #page-site-index and .usermenu to switch off the first-child on the user menu on the front page only. 

I have now done exactly that, as it's the behaviour I'm after.