Hide custom menu before login - Herald theme

Hide custom menu before login - Herald theme

by James Pearce -
Number of replies: 8

Hello all,

I would like to hide my custom menu items until a user has logged in to my site. Essentially, this means hiding the custom menu from the front page and login page.

Any help much appreciated.

Thank you


Moodle = v3.1.2

Theme = Herald v2.3

URL = paramediclearning.org

Average of ratings: -
In reply to James Pearce

Re: Hide custom menu before login - Herald theme

by Richard Oelmann -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

As the Herald theme is a commercial theme, you will need to ask the theme developers themselves for support. It is unlikely anyone in the community will have access to that particular theme.

However, general advice would be that you can wrap the bit of code that calls the custom menu in a conditional statement in the relevant layout files, something along the lines of:

if (isloggedin() ) {
    echo $OUTPUT->custom_menu();
}


Richard


Average of ratings: Useful (1)
In reply to James Pearce

Re: Hide custom menu before login - Herald theme

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

Alternatively, you can try adding this CSS...if there is provision within the theme to add Custom CSS?

#page-site-index.notloggedin .topbar, 
#page-login-index.notloggedin .topbar {
    display: none;
}

Should fix that...

Mary

Average of ratings: Useful (3)
In reply to Mary Evans

Re: Hide custom menu before login - Herald theme

by James Pearce -

Thanks Mary,

Yes there is a place for Custom CSS and your code worked.

Thank you very much!


In reply to Mary Evans

Re: Hide custom menu before login - Herald theme

by James Pearce -

One more question Mary, 

Is it possible to add similar Custom CSS to hide the front page topic section area until a user is logged on?

Thank you

In reply to James Pearce

Re: Hide custom menu before login - Herald theme

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

Yes...

#page-site-index.notloggedin .sitetopic { display: none;}

Average of ratings: Useful (2)
In reply to Mary Evans

Re: Hide custom menu before login - Herald theme

by Zeid Fanous -

Hi Mary, 


would it be possible to just hide the menu items and not hide the whole navbar?