Colour and Size of footer

Colour and Size of footer

by mart van der niet -
Number of replies: 23

Two questions on the footer:

  1. It displays a different (lighter) colour from the one set in  theme_essential | footercolor
    (checked in config_pugins: right colour is stored there)
    Anyone seen this?
  2. How can I change the height of the footer? The size of the footer is too big in relation to the header
    Can't find a css setting for it....
Attachment Untitled.png
Average of ratings: -
In reply to mart van der niet

Re: Colour and Size of footer

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

For '1' is the screen shot representative of the issue?  If so then the header is the same colour as the footer '#8B0051' so no fault.

In reply to Gareth J Barnard

Re: Colour and Size of footer

by mart van der niet -

Yes, they are screencaptures. Must be a visual trick: colour seems lighter because the box is bigger. So only question left: how to resize the footer to the same size as the header.....

In reply to mart van der niet

Re: Colour and Size of footer

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Mart,

For '2' use developer tools in the browser to ascertain the 'min-height' of the element.  Then make your own based upon the same CSS selector and put it in the 'Custom CSS' setting of the theme.  This should work because the 'Custom CSS' is included last (even when cached) and therefore a redeclaration of the same selector redefines it.

G

In reply to Gareth J Barnard

Re: Colour and Size of footer

by mart van der niet -

Hi Gareth,

 

Thanks for the pointer to custom css. However, it is not quite as easy as I would have hoped. The property that influences the height of #page-footer is max-height. However, when setting that the copyright/footnote text drops under the page-footer....

In reply to mart van der niet

Re: Colour and Size of footer

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok, so a silly question.  What exactly do you want?

Do you want:

  • The space of the footer to be reduced and therefore the size of the content within?  If so, then look at the CSS controlling the content and alter that.
  • Some elements of the footer to be taken out and placed elsewhere such that the size is reduced?  If so, then look at the layout files and move the content outside of the block that has the colour rendered by CSS upon it or move / adjust the CSS that applies the colour setting to that of another child element.

Cheers,

G

In reply to Gareth J Barnard

Re: Colour and Size of footer

by mart van der niet -

Sorry for not being very clear, maybe too heavy xmas dinnersmile

I want the height of the footer "container" to be smaller, preferably the same size as the height of the div that holds the sitename, language dropdown, dashboard dropdown etc.

Adding custom css seems not to work for the page-footer, so I edited the includes/footer.php from the essential theme, and commented a part out:

 

    <div class="row-fluid">
        <?php
                    //echo $OUTPUT->essentialblocks($footerl, 'span4');

                    //echo $OUTPUT->essentialblocks($footerm, 'span4');

                    //echo $OUTPUT->essentialblocks($footerr, 'span4');
        ?>
     </div>

Not very elegant, but it reduces the size of the page-footer....

In reply to mart van der niet

Re: Colour and Size of footer

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

That would be because the size of the footer is largely governed by what is in it rather than it having a fixed size to set.

In reply to Richard Oelmann

Re: Colour and Size of footer

by mart van der niet -

Hi Richard,

I doubt that:

when there is no copyright, no footnote and no Moodle docs ref, the box is still the same size.

In reply to mart van der niet

Re: Colour and Size of footer

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

Well, if I remove the footer blocks and the footnote/copyright in my copy of essential using firebug then the footer shrinks to a single line.

Along with the fact that I can't find a min-height or height instruction in css, then I would say, from my point of view, that certainly suggests to me that the height of the footer is based on its contents.

The coloured band I think you are trying to match to is the custom menu navigation bar, which appears to have a min-height set of 40px. So you could try setting the height of the footer to 40px to match that as a fixed height, but you will have to manage whatever content is in there, such as through your removal of the footer blocks.

Richard

Attachment Screenshot from 2013-12-27 183555.png
In reply to mart van der niet

Re: Colour and Size of footer

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

Hi Mart,

The only way to shrink the footer is to remove all the elements from it in the layout files.

This is all you need if you want it devoid of everything, other than debugging tools.

    <footer id="page-footer" class="container-fluid">
        <?php echo $OUTPUT->standard_footer_html();?>
    </footer>

Cheers

Mary

In reply to Mary Evans

Re: Colour and Size of footer

by mart van der niet -

Hi Mary,

Thanks for the hint, but.....

  • I want a copyright notice
  • When removing parts of the footer as indicated in my earlier post, this has the strange consequence that the filepicker does not work anymore (waiting icon keeps spinning) and also the edit box (like this) does not work, ony accepts html (same page with theme 'clean' works ok).
    So I am a bit cautious about fiddling with the footer code.

Let's hope the owner of this awesome theme can shed some light on this!

In reply to mart van der niet

Re: Colour and Size of footer

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

Well depending on the version of Moodle you are using, some of the issues with the file picker have been fixed. You really need the most up-to-date version of Moodle to keep abreast of the changes.

The file picker requires id="page-header" and id="page-footer"  changing the content of the footer should not affect the file picker unless the id="page-footer" is missing?

Alternatively you could just add add this for the footer...which would give you the footnote and copyright

  <footer id="page-footer" class="container-fluid">
    
    $hascopyright = (empty($PAGE->theme->settings->copyright)) ? false : $PAGE->theme->settings->copyright;
    $hasfootnote = (empty($PAGE->theme->settings->footnote)) ? false : $PAGE->theme->settings->footnote;

    <div class="footerlinks row-fluid">
        <hr>
        <p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')); ?></p>
        
        <?php if ($hascopyright) {
            echo '<p class="copy">&copy; '.date("Y").' '.$hascopyright.'</p>';
        } ?>

        <?php if ($hasfootnote) {
            echo '<div class="footnote">'.$hasfootnote.'</div>';
        } ?>
        </div>    
    
        <?php echo $OUTPUT->standard_footer_html();?>
    </footer>

I think Julian must be on holiday smile

Cheers

Mary

In reply to Mary Evans

Re: Colour and Size of footer

by mart van der niet -

Hi Mary

(I'm on Moodle 2.6+ (Build: 20131205))

What do you mean by "just add this to the footer" ? Add it to the footer.php ? Can't imagin that will work...

 

(Well I think he's earned his vacation!)

In reply to mart van der niet

Re: Colour and Size of footer

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Could another solution be to move the CSS attribute that applies the colour to another tag within the footer such that the content is still the same but the actual bar will be smaller.

In reply to mart van der niet

Re: Colour and Size of footer

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

Mart, rather than just saying that you can't imagine it will work, it would be worth trying it out!

Attached is a footer.php file which has Mary's code in it to replace the current essential one. The alternative would have been to just replace the include call in the layout files themselves with Mary's code as given (without the <footer> line itself which is already in the layout files not in the footer.php)

It does work - I've just tested it, as Im sure Mary would have before posting it.

Richard

In reply to mart van der niet

Re: Colour and Size of footer

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

I wrote 'for the footer' NOT 'to the footer'

I was meaning in the layout files, columns1.php columns2.php & columns3.php, which is where the footer code is. The footer.php is an include which I have NOT included!

You asked for help getting the height of the footer down to a minimum. Now you are finding every excuse not to use ideas for doing just that.

The reason the footer is as it is, is because of the different line heights for the elements stored in it.

Mary

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

Re: Colour and Size of footer

by mart van der niet -

(Well to show I'm not finding excuses...)

As far as I understand

Replace in colums*.php

    <footer id="page-footer" class="container-fluid">
        <?php require_once(dirname(__FILE__).'/includes/footer.php'); ?>
    </footer>

with:

  <footer id="page-footer" class="container-fluid">

    $hascopyright = (empty($PAGE->theme->settings->copyright)) ? false : $PAGE->theme->settings->copyright;
    $hasfootnote = (empty($PAGE->theme->settings->footnote)) ? false : $PAGE->theme->settings->footnote;

    <div class="footerlinks row-fluid">
        <hr>
        <p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')); ?></p>
        
        <?php if ($hascopyright) {
            echo '<p class="copy">&copy; '.date("Y").' '.$hascopyright.'</p>';
        } ?>

        <?php if ($hasfootnote) {
            echo '<div class="footnote">'.$hasfootnote.'</div>';
        } ?>
        </div>    
    
        <?php echo $OUTPUT->standard_footer_html();?>
    </footer>


This results in the strings being printed in the footer:
"$hascopyright = (empty($PAGE->theme->settings->copyright)) ? false : $PAGE->theme->settings->copyright; $hasfootnote = (empty($PAGE->theme->settings->footnote)) ? false : $PAGE->theme->settings->footnote;"

Do we need some tags? :

<?php

    $hascopyright = (empty($PAGE->theme->settings->copyright)) ? false : $PAGE->theme->settings->copyright;
    $hasfootnote = (empty($PAGE->theme->settings->footnote)) ? false : $PAGE->theme->settings->footnote;

?>

 

That takes care of the error, and now the footer has been resized. Alas, now the filepicker problem appears again....

 

(btw: date("Y"). seems not to be working, Should echo the current year, isn't it?)

 

 

 

In reply to mart van der niet

Re: Colour and Size of footer

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

PHP Tags = yes.

Filepicker issue will be breaking JS somewhere.  Turn on browser developer tools and look at the console on page load with developer level debugging in Moodle.

Check 'date' against http://www.php.net/manual/en/function.date.php.  And what is it actually outputting?  Please state what the actual error is then we can help you!  If it was 1970 for instance that is the Unix Datetime Epoch and would indicate a server configuration issue.

In reply to Gareth J Barnard

Re: Colour and Size of footer

by mart van der niet -

Date problem solved, filepicker and editor problem stay...

In reply to mart van der niet

Re: Colour and Size of footer

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

So!..... "Filepicker issue will be breaking JS somewhere.  Turn on browser developer tools and look at the console on page load with developer level debugging in Moodle." - report any errors please.

In reply to Gareth J Barnard

Re: Colour and Size of footer

by Saeed Amiri -

Hi Gareth and everyone

I'm using the latest version of the theme "essential" in moodle 2.6 and have the same problem discussed in this thread. My problem is when I edit columns*.php and the frontage.php by replacing the original

<footer id="page-footer" class="container-fluid">
<?php require_once(dirname(__FILE__).'/includes/footer.php'); ?>
</footer>

with 

<footer id="page-footer" class="container-fluid">
<?php echo $OUTPUT->standard_footer_html();?>
</footer>

the editor of the topic section does not work, i.e it shows only a rudimentary box with some html codes in it. Following Gareth's advice, I turned on Firefox's developer debugging tool and I think the debugger highlighted the error? The highlighted line is as follows: 

<body id="page-course-editsection" class="format-site path-course gecko dir-ltr lang-en yui-skin-sam …e has-region-footer-right used-region-footer-right jsenabled"

In addition, I have also attached the text file of the browser console, if that helps.

Somethings are wrong there but I'm not quite sure what I should be looking for and what to do? Could anyone help please?

I wish the theme owner could also help me on this.

Best

Saeed

In reply to mart van der niet

Re: Colour and Size of footer

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

Sorry about that I missed off the <?php ... ?> tag!

Ah well at least you found that out...I would have been very suspicious if you hadn't! smile