typo3typoscripttypolink

create menu with baseURL in front of link (absolute links)


When I create my menu I only have relative paths for the different menu links. How do I get an absolute URL (i.e. a typolink with the baseURL in front of it).

I can think of either defining a variable or write the domain name in the wrap. E.g.

10.wrap = <option value="http://www.domain.com/|">

But are there better options?


Solution

  • Set config.absRefPrefix = http://www.yourdomain.com/sub/path/. That will prefix any properly generated site-root relative links with the domain.

    There may be an alternative way using domain records (Linking across domains in multidomain-sites does exactly what you want), but I can't point you to anything there.