Where - To change footer Link

Where - To change footer Link

by Ravi Vare -
Number of replies: 13
Hi,
i have changed moodlelogo at footer by 'Sun Infosys' (Plz. see screenshot)

Now i want to change 'Link' too.

www.moodle.org BY www.suninfosyseducation.com

How to do this?
Pl. assist

TIA

Ravi
Attachment footer link.jpg
Average of ratings: -
In reply to Ravi Vare

Re: Where - To change footer Link

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

Ravi,

No screenshot attached.

What theme are you using?

In most of the core themes, this would be part of the

  echo $OUTPUT->standard_footer_html();

and would need to be over-ridden by a custom renderer

Alternatively, you could hide/delete the line above and add your own code for the footer, including the image and link you want, OR if the theme you are using has it, use the footnote section of the custom settings to add the footer you want while hiding the standard_footer_html()

 

Richard

In reply to Richard Oelmann

Re: Where - To change footer Link

by Ravi Vare -
Hi Richard,
thanks for response.

i have attached 'screenshot'

But it can't be seen.
i am still confusing

Have you facing same problem regarding 'attachment'

I am using moodle 2.1
theme- standard
Attachment footer link.jpeg.JPG
In reply to Ravi Vare

Re: Where - To change footer Link

by Ravi Vare -
at the frontpage, there is moodlelogo(in yellow colour) at the bottom.

i have replaced it with our logo. OK

Now i want to change Link(www.moodle.org with moodlelogo) also

I want to put our HOME link

Best regards,

Ravi
In reply to Richard Oelmann

Re: Where - To change footer Link

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

apologies Ravi, it's not the standard_footer_html() it's the

        echo $OUTPUT->home_link();

I need to put my glasses on!!!

standard theme does not have any layout files of its own - it uses base as a parent and inherits the layout files from there.

So, either you can copy the layout files from base into your theme and edit that to remove the line above and put your own code in to add an image/link to the frontpage, or you can create a custom renderer override for the home_link (see here). this is the section that would need to be 'over-ridden'

 

    public function home_link() {
        global $CFG, $SITE;

        if ($this->page->pagetype == 'site-index') {
            // Special case for site home page - please do not remove
            return '<div class="sitelink">' .
                   '<a title="Moodle" href="http://moodle.org/">' .
                   '<img style="width:100px;height:30px" src="' . $this->pix_url('moodlelogo') . '" alt="moodlelogo" /></a></div>';

        } else if (!empty($CFG->target_release) && $CFG->target_release != $CFG->release) {
            // Special case for during install/upgrade.
            return '<div class="sitelink">'.
                   '<a title="Moodle" href="http://docs.moodle.org/en/Administrator_documentation" Xonclick="this.target=\'_blank\'">' .
                   '<img style="width:100px;height:30px" src="' . $this->pix_url('moodlelogo') . '" alt="moodlelogo" /></a></div>';

        } else if ($this->page->course->id == $SITE->id || strpos($this->page->pagetype, 'course-view') === 0) {
            return '<div class="homelink"><a href="' . $CFG->wwwroot . '/">' .
                    get_string('home') . '</a></div>';

        } else {
            return '<div class="homelink"><a href="' . $CFG->wwwroot . '/course/view.php?id=' . $this->page->course->id . '">' .
                    format_string($this->page->course->shortname) . '</a></div>';
        }
    }

 

HTH

Richard

 

PS. Forgot to say above - You should not be editting the standard theme itself. Make a copy of the theme and rename it, then edit that (see cloning a theme here)

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

Re: Where - To change footer Link

by Ravi Vare -
Hi Richard,
i can't attach any images/screenshots any more.(this is very amazing)
could you provide me your personal email-ID.

Now i can't change theme in moodle 2.1

May i provide some screenshots through your ID
Then you can easily understand the problem.


Best Regards,
Ravi
Attachment theme.jpg
In reply to Ravi Vare

Re: Where - To change footer Link

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

Have you checked the image size Ravi - there is a max of 100KB which means you can't just add a screenshot without reducing it first.

Richard

PS. there is no need to send me a separate personal message each time you post - as I am subscribed to this forum I get a message through my email whenever there are posts anyway, and as I am not always on my PC (might seem like it to my wife sometimes!) I'm likely to get the notice of your provate message the same time as the one about the main post.

 

Rich

In reply to Richard Oelmann

Απάντηση: Re: Where - To change footer Link

by Andreas Panagiotopoulos -

I would also like to change the footer link and I am ok with this.

But I would also like to add 2 links (Terms of use and Privacy policy) with a copyright text in the left side of the footer section.

So I add a table in the function standard_footer_html() (/lib/outputrenderers.php) like this:

 

        $output .= '<table width="50%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td width="100%">' . '<a href="http://www.xxxxxx.com/" target="_blank">' . '<small>' . "Terms of Use" .'</a>' . " | " . '<a href="http://www.xxxxxx.com/ target="_blank">' . "Privacy Policy" . '</a><br>' . "&copy; Copyright 2011 - Leading Tourism Cluster S.A." . '</small></td>
</tr>
</table>';
return $output;

But the result is the table to be shown at the left-bottom of the footer.

How can i change this in order the table to be shown in the same line as login info or logo?

 

Thank you in advance!

Andreas P.

In reply to Andreas Panagiotopoulos

Re: Απάντηση: Re: Where - To change footer Link

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

hi Andreas,

First of all, you should not be making changes to the core code of moodle. If changes to output renderers are needed you should do it be creating a renderer over-ride (see here)

But really this shouldn't be necessary, just include the table (or set up some new divs) in the php code for the page itself. Just include the existing page footer content in one of the cells/divs.

Richard

In reply to Andreas Panagiotopoulos

Re: Απάντηση: Re: Where - To change footer Link

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

Hi,

Richard is right, you should not attempt to change system files. Beside we don't give out help to those who have problems; as you have now, when the cause of the problem is your own fault.

Try reading some tutorials:

Development: Themes 2.0

HTH

Mary

In reply to Mary Evans

Απάντηση: Re: Απάντηση: Re: Where - To change footer Link

by Andreas Panagiotopoulos -

Ok ok, thank you very much for your support!

I didn't know that it is not suggested to edit the core files of moodle!

I will go through documentation you suggest in order to find a solution..

Thank you very much indeed!

ANdreas P.

In reply to Andreas Panagiotopoulos

Re: Απάντηση: Re: Απάντηση: Re: Where - To change footer Link

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

Hi Andreas,

You can make any changes you like to layout/general.php and layout/frontpage.php in your theme. This is where you have absolute freedom to do what you want . If you dont like the code then change it there.

HTH

Mary

In reply to Ravi Vare

Re: Where - To change footer Link

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

Hi Ravi,

Did you sort this out.  The discussion seemed to me to be confusing.

You should be able to add your own image and link or just a site name with a link in the footer part of general.php and frontpage.php depending on which theme you are making changes to.

HTH

Mary