1

In the following code, I want site_index to continue to point to http://blah.com/ but instead it points to something like http://blah.com/category/catalog/downloads:

{exp:channel:categories channel="downloads" show_empty="no" style="linear"}
    <a href="{path='site_index'}/downloads">{category_name}</a>
{/exp:channel:categories}

How do I prevent channel:categories from taking over the site_index variable?

2

You'd be best left not messing with that and using {site_url} instead.

http://ellislab.com/expressionengine/user-guide/templates/globals/single_variables.html#site-url

2
  • Thanks, @Stephen. Only downside I've found to using {site_url} instead is that it doesn't automatically include the /index.php? in the URL, which my site's server currently requires. So if we ever remove the /index.php? we'll need to update this link.
    – cmal
    Dec 21 '13 at 16:02
  • If you need to, you can setup a snippet as {site_url}/index.php? and just call the snippet instead. Dec 21 '13 at 18:21

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.