Hot answers tagged

4

.htaccess should always be faster because it doesn't involve PHP or Craft at all. But on top of that the {% redirect %} tag should be pretty darn quick. Upon hitting it, Craft immediately calls Yii's CHttpRequest->redirect(), which sets the redirect header and terminates the current request.


4

Based on your comments, I'd recommend creating a new entry type in your section. Create a "Redirect" entry type which only contains a URL link (or an Entry field) so the page knows how to handle the redirect. For any entries that need to be converted to a redirect, simply swap the entry type to use this instead. Then you can simply map that entry type to a ...


3

You can use the level method to determine which iteration of the nav you are on and change the behavior: <ul> {% set pages = craft.entries.section('page') %} {% nav page in pages %} <li> {% if page.level == 1 %} <a href="/">{{ page.title }}</a> {% else %} {{ page....


Only top voted, non community-wiki answers of a minimum length are eligible