3

I'm aware that $front_page is a variable used in page.tpl, but is there a way to use it (or something similar other than a direct link) to print the index url in a node.tpl?

1 Answer 1

4

Absolutely:

function MYTHEME_preprocess_node(&$vars) {
  $vars['front_page'] = url();
}
1
  • Brilliant, works perfectly. Thank you very much! Do you have any tip on where I can read up on how this works in general?
    – Lenny
    Dec 11, 2015 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.