homelink

homelink

by Tlacaelel Flores -
Number of replies: 3

I am developing a theme for my site and want to add a logo to it with a link to the home page, I am currently using <a href="/index.php" to append the homelink to the logo, however in the event that moodle is not in the root that will not work, how is the homelink printed in moodle without printing anything but the link, I tried echo $home_dir but that prints an anchor with some predefined string like this <a href="thisisthehomelink" >Home</a>

Average of ratings: -
In reply to Tlacaelel Flores

Re: homelink

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

The moodle directory is stored in config and can be accessed as

$CFG->wwwroot

so <a href="<?php echo $CFG->wwwroot; ?>">Home</a> should do the trick

HTH

Richard

(Edited by Mary Evans - original submission Thursday, 11 August 2011, 08:39 PM)

Added " " in a href! smile