How to hide the full site name in your theme?

Re: How to hide the full site name in your theme?

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

Hi,

There is no h1.headermain in Clean theme. 

To remove the heading from the page however would be to change this line in clean/lib.php

https://github.com/lazydaisy/moodle/blob/master/theme/clean/lib.php#L145

you need to remove the reference to the heading, replacing everything after the Equals sign like this...

$return->heading = ' ' ;

Cheers

Mary

In reply to Mary Evans

Re: How to hide the full site name in your theme?

by P L -

Thank you, Mary.

In reply to Mary Evans

Re: How to hide the full site name in your theme?

by Rafael Maragato -

Mary, you ROCK!
Thank's smile

In reply to Rafael Maragato

Re: How to hide the full site name in your theme?

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

Yeah!

In reply to Mary Evans

Re: How to hide the full site name in your theme?

by teresa campos -

Hi my English is very bad but I am try to explain my question in Moodle 3.4 change the part of code how you mention 

you mention this 

Moodle 2.8

if (!empty($page->theme->settings->logo)) {

        $return->heading = html_writer::link($CFG->wwwroot, '', array('title' => get_string('home'), 'class' => 'logo'));

    } else {

        $return->heading = $output->page_heading();

    }

Moodle 3.0.4

 // Only display the logo on the front page and login page, if one is defined.

    if (!empty($page->theme->settings->logo) &&

            ($page->pagelayout == 'frontpage' || $page->pagelayout == 'login')) {

        $return->heading = html_writer::tag('div', '', array('class' => 'logo'));

    } else {

        $return->heading = $output->page_heading();

    }

You have any idea how to do the same  in this verson   Moodle 3.0.4

thanks =)

(Edited by Mary Evans - corrected typo for Moodle version - original submission Thursday, 26 May 2016, 9:00 PM)

In reply to teresa campos

Re: How to hide the full site name in your theme?

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

Please can you confirm the Moodle version - there is no Moodle3.4, Moodle 3.1 has only just been released smile

But Mary's advice was to remove the end part of the $return line, which is the same in both the snipppets you have posted

So instead of

$return->heading = $output->page_heading();

you would have

 $return->heading = ' ' ;
In reply to Richard Oelmann

Re: How to hide the full site name in your theme?

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

Hi Richard,

I changed the typo of Teresa's post from 3.4 to 3.0.4 as it was pretty obvious.

Changing Clean theme for the heading, especially in the lib.php, is not going to work as it's all governed by the renderer in clean/classes/core_renderer.php at this point in the layout files: See link to Moodle

https://github.com/lazydaisy/moodle/blob/master/theme/clean/layout/columns3.php#L78

So the easiest way to do this is add some CSS like we used to do in the olden days, except is is now using a different class.

.page-header-headings { visibility: hidden; }

or

.page-header-headings { display: hidden none;} SEE EDIT:

EDIT: Sorry I make a mistake last night when I wrote this and was, most probably, half asleep!

I have amended the mistake to read:

Thanks Richard for pointing this out! You are a Star!
https://moodle.org/mod/forum/discuss.php?d=170574&parent=1344560

.page-header-headings { display: none; }

Cheers

Mary

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

Re: How to hide the full site name in your theme?

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

.page-header-headings { display: hidden;}

Should be

.page-header-headings { display: none;}

smile

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

Re: How to hide the full site name in your theme?

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

Oh gosh...thanks Richard!!!

I have just edited my mistake.

Cheers

Mary

In reply to Mary Evans

Re: How to hide the full site name in your theme?

by tery campy -

Hi thanks for help me tongueout

 I only comment this line   <?php echo $OUTPUT->full_header(); ?>      from 

C:\wamp\www\moodle3.04\theme\clean\layout\columns3     and it works for me. moodle 3.0.4  =D big grin



I didn't  try to change this part .page-header-headings { display: none;} because I don't know where is the file, where I need put this =(







In reply to tery campy

Re: How to hide the full site name in your theme?

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

The fix I suggested is CSS, so you would need to add it in the Cleansettings page where there is a box called Custom CSS

Cheers

Mary

In reply to tery campy

Re: How to hide the full site name in your theme?

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

The fix I suggested is CSS, so you would need to add it in the Cleansettings page where there is a box called Custom CSS

Cheers

Mary

In reply to Richard Oelmann

Re: How to hide the full site name in your theme?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I just tried this ".page-header-headings { display: none;}" in MORE, and it doesn't work.  Do I have to modify it differently?  I am adding this as custom CSS.  I would like to remove the Full Site Name from only my frontpage because right now, I get two "Courses" being shown (See below, shows two "courses", where "Courses" = my Full Site Name.).  On other pages, this site name gets replaced with the course name, which I still want to happen.  (I am not sure if the Full site name gets shown anywhere else, except on the frontpage).

Attachment Site Full Name.jpg