Hide forum name from main page with css code

Hide forum name from main page with css code

by Ivan Jakopec -
Number of replies: 4

Hi to everybody,


on main page on moodle i have forum (News forum). I want to hide forums name from main page with css code. 

So, can somebody tell me whitch css code i need to type in field "Custom CSS" to hide this title on main page (Picture 1).

I have installed moodle 2.6.3+.


Best regards,

Ivan Jakopec

Attachment Picture_1.jpg
Average of ratings: -
In reply to Ivan Jakopec

Re: Hide forum name from main page with css code

by Hugo Schouppe -

Hi Ivan,

At my site (with easy-theme) I have managed to hide it with the following CSS.

#region-main h2 {
display: none;
}

You can add this CSS probably in your theme settings: site administration > appearance > theme > theme settings (at the bottom of the page).

Good luck.
In reply to Hugo Schouppe

Re: Hide forum name from main page with css code

by Ivan Jakopec -

Thanks for your response! 


But the problem is that, that with this code (#region-main h2 {display: none;}) i will hide all heading 2 titles in whole moodle (in all pages of moodle), but i only want to hide the title only from the main page on moodle!


Does there exist a path that would lead only to the main (home) page, then I will be able to hide title only from the main page? 

Such as the path that leads to the books:

.path-mode-book h2 {

display: none;

}


Best regards and thanks for help,

Ivan Jakopec


In reply to Ivan Jakopec

Re: Hide forum name from main page with css code

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

Hi if you look at the source code you will see that the site news on the Frontpage has a unique class or id you need to find that first then add something like...

.site-news h2 { visibility: hidden}

or #page-index .site-news h2 { display: none}

PS...

I think from memory the id is site-news-forum so the CSS would be more like this...

#site-news-forum h2 { display: none}

also the difference between display none and visibility hidden is that the first removes the item and the space it would have taken up whereas the second removes the item but leaves the space. So this is a personal choice on your side.

HTH

 Mary

In reply to Mary Evans

Re: Hide forum name from main page with css code

by Ivan Jakopec -

That's just what I needed! Problem solved! Thank you very much Mary!