0

This is pretty straight forward. How do I print a link to the homepage as field in Views?

I have added a global text field with html code <a href="/">Home</a> but this is just the path to the root & my website is installed in a subdomain.

Using D7 and latest Views module.

7
  • 1
    @NishantP I'm sure he meant print l('front','',array('absolute'=>true)); - but I don't remember how to do it in views field easily. Commented Jun 12, 2015 at 11:01
  • @Mołot I think OP not being able to clear that how to explain there issue. First we need surety from OP. Commented Jun 12, 2015 at 11:04
  • Did you read the edited question? Commented Jun 12, 2015 at 11:05
  • Try to check the LINK. I hope you are talking about this & you will get help from this url. Commented Jun 12, 2015 at 11:11
  • Thanks for your effort. Unfortunately, that is not what I'm looking for. I'm looking for a way to display a field as a link to frontpage in views (as mentioned in the question above, the "/" href does not take me to the frontpage, it is taking me to root domain). Commented Jun 12, 2015 at 12:44

1 Answer 1

5

it should work this way:

  • create the global text field, with the text as the link text -

enter image description here

  • then rewrite the results, and output as a link using <front> as the path -

enter image description here

1
  • Thank you so much! Didn't know it is that simple. And a very important asset - now I know <front> could be used as a token in Views. Commented Jun 12, 2015 at 21:32

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.