Removing the Site Name from the Header

Removing the Site Name from the Header

by Art Wolinsky -
Number of replies: 21

I run a Moodle for an Internet charity comprised of all volunteers.  Unfortunately, none of us are proficient in PHP.  As a BASIC programmer from the 80's and 90's, I'm muddling around.

We don't want the name of the site to appear in the Header.  We want to use a banner withour logo.  I was able to find the line of code in header.htm that displays it on all pages but the front page.  However, it still appears on the front page.

Can anyone point me to that piece of code?

Thanks!

Average of ratings: -
In reply to Art Wolinsky

Re: Removing the Site Name from the Header

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

Hi Art,

Welcome to Moodle!

You will find these Moodle docs usful when customising your theme.

Themes FAQ Themes 2.0 FAQ CSS FAQ

As for the page title in the header ...that all depends on which version of Moodle you are using.

Moodle 1.9 - moodle/themes/yourthemname/header.html

there are two instances which you can delete or comment out...this is the line

<h1 class="headermain"><?php echo $heading ?></h1>

In Moodle 2.x.x it's very similar

<h1 class="headermain"><?php echo $PAGE->heading ?></h1>

but in this case there are a couple of layout files where you will find this line of code. Namely...

moodle/themes/yourthemname/layout/frontpage.php

moodle/themes/yourthemname/layout/general.php

HTH

Mary

In reply to Mary Evans

Re: Removing the Site Name from the Header

by Art Wolinsky -

Thanks for the quick reply Mary!  Sorry I didn't mention it was 1.9.  At this point the name doesn't appear on any page except the one you see after you login.  This is where we got the theme http://www.themza.com/moodle/ability-to-learn.html

Here's what the "most likely suspect" section of header.html looks like. I'm not sure what to do.  Anything I do only messes up the page in some way.  It's driving me crazy.

<div id="page">
<?php //Accessibility: 'headermain' is now H1, see theme/standard/styles_layout.css: .headermain
if ($home) {  // This is what gets printed on the home page only
?>
<?php print_container_start(true, '', 'header-home'); ?>
<!--<h1 class="headermain"><?php echo $heading ?></h1>-->
<div class="headermenu"><?php echo $menu ?></div>
<?php print_container_end(); ?>
<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
?>
<?php print_container_start(true, '', 'header'); ?>
<h1 class="headermain" style="padding-left:20px;"><?php echo ?></h1>
<div class="headermenu"><?php echo $menu ?></div>
<?php print_container_end(); ?>
<?php } ?>

In reply to Art Wolinsky

Re: Removing the Site Name from the Header

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

HI,

The lines which you need to delete are the one I have highlighted below...

<div id="page">
<?php //Accessibility: 'headermain' is now H1, see theme/standard/styles_layout.css: .headermain
if ($home) {  // This is what gets printed on the home page only
?>
<?php print_container_start(true, '', 'header-home'); ?>
<!--<h1 class="headermain"><?php echo $heading ?></h1>-->
<div class="headermenu"><?php echo $menu ?></div>
<?php print_container_end(); ?>
<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
?>
<?php print_container_start(true, '', 'header'); ?>
<h1 class="headermain" style="padding-left:20px;"><?php echo ?></h1>
<div class="headermenu"><?php echo $menu ?></div>
<?php print_container_end(); ?>
<?php } ?>

HTH

Mary

PS: I trust you are aware that all Themza themes have hidden links to their site within the themes php code? There is a big chunk in config.php, plus some more in the header and I think the footer too.  This all goes against the GNU GPL which Moodle is all about, freedom to distribute and share, with no hidden agenda.

In reply to Mary Evans

Re: Removing the Site Name from the Header

by Art Wolinsky -

Hi Mary,

Once again, thanks for the quick repply and once again, sorry it took so long to reply.  Unfortunately, the edits didn't do the trick, but I stepped back and looked at the problem differently.  Instead of changing the code, I simply did what I probably should have done in the first place.  I changed the banner to make it unnecessary to eliminate the superimposed text.

As far as Themza having code hidden, I didn't see any.  This is a free template. The only thing I saw were two buttons at the bottom of the page. One led to the template download and the other to their hosting offer.  I saw nothing in their site that prohibited the removal of those buttons.  Am I missing something?

Once again thanks for your response.  The work you are doing here is nothing short of amazing.  You are worth your weight in gold to the community!

Best Regards,

Art Wolinky

In reply to Mary Evans

Re: Removing the Site Name from the Header

by kay stephen -

Hi

I recently applied the Bootstrap theme and removed the site name by the following process.  I'm not sure if this is frowned upon but it works.

Access the theme configuration page you are using and enter the code below into the custom css field:

.headermain {
visibility: hidden;
}

 

In reply to Mary Evans

Re: Removing the Site Name from the Header

by Heinser Diaz -

Hello Mary,

I'm using Moodle 2.0 and i can't find those files in that location you mentioned, i want to use the standard theme. The only way that i could mofidy the header to add a customized logo was thru the core.css file on the style folder.

Thanks in advance.

In reply to Heinser Diaz

Re: Removing the Site Name from the Header

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

Heinser,

Standard uses Base as a parent and uses the base layout files unmodified and so does not have the layout folder/files itself.

If you want to use standard, but modify the layout files as Mary suggests, you would have to copy the folder from the base theme into your cloned version of standard (don't make changes to the core themes themselves, always create a copy to alter), otherwise you are right, it is possible to do it through css, just that it is probably neater to do it the way Mary has suggested in most cases.

HTH

Richard

In reply to Mary Evans

Re: Removing the Site Name from the Header

by dre findley -

hi mary, what about in moodle 2.5 ?

Dre

In reply to dre findley

Re: Removing the Site Name from the Header

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

What about it?

In reply to Mary Evans

Re: Removing the Site Name from the Header

by dre findley -

How would i put a logo in the very top navbar instead of site short name, using (clean theme)

In reply to dre findley

Re: Removing the Site Name from the Header

by T K -

My header is currently showing a short name, how do i change it to full name?

im using moodle 2.8

In reply to T K

Re: Removing the Site Name from the Header

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

Change it in Administration > Site Administration > Frontpage Settings

In reply to Mary Evans

Re: Removing the Site Name from the Header

by T K -

Thanks Mary!
ANother question here:

We are trying to apply clean theme for a particular theme, and then we added below codes in the css to make the background blue in color. Funny thing, the courses in that theme do appear the selected blue color, HOWEVER the category page is still plain white. How do I fix this? I need the category color to be the same blue.


body {

  background-color:#cfd8e2;

  color: #0C2E82;

 }

In reply to T K

Re: Removing the Site Name from the Header

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

That's because the content is probably white, so try ...

 .pagelayout-coursecategory #page-content { add CSS here }

or this 

 .pagelayout-coursecategory #page { add CSS here }

In reply to Mary Evans

Re: Removing the Site Name from the Header

by T K -

THanks Mary, i used #page and it did work but thre is a white line between the body and header


img3


using #Page-content i get a large white like this:


img


how to solve this? i want it to be fully blue till the header


In reply to T K

Re: Removing the Site Name from the Header

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

I think from memory it's a bottom margin set in the navbar. So try adding the following to your themes CSS SECTION OF THE CUSTOM SETTINGS PAGE WITHIN THE THEME ITSELF.

Oops...Cap Lock got stuck!

here is the CSS you need.

.navbar { margin-bottom: 0}
In reply to Mary Evans

Re: Removing the Site Name from the Header

by T K -

It doesnt help, still the same

In reply to dre findley

Re: Removing the Site Name from the Header

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

OK...I have amended the original comment where I said Moodle 2.0.

As it happens it is still valid for Moodle 2.5+

Although it may differ in each theme.

Hope this helps.

Cheers

Mary

In reply to Mary Evans

Re: Removing the Site Name from the Header

by Maria Silva -

Hi!!! I have another question about how modifying a cours title. In my case:

I cloned a leatherbound theme, on the middle of header I inserted a logo, and on the left-side hand I would insert a cours name, but my course name its too long!

I will need something like this:

<h1>Training Lessons<br>

for continuing education </h1>

When I try to insert my title, it is over my logo.

 

I will need to modify a $PAGE->heading variable on my general.php. I tried to insert a carriage retourn "\n" or <br> but it doesn't work ( I dont need my title in a only one line)

 

Someone knows how can I make this modification?

 

thanks!!