1

I'm using a route to use a different template, but whatever I try the page remains unchanged, my structure is set as:

entry url format: {slug}

entry template: _pages/_entry

I want an entry's slug to use a different template - would this possibly be affecting the route being followed?

I want the entry 'home' to use the 'index' template (and not the '_home' template which exists at _pages/_home)

I've cleared my cache and updated indexes

  • I used {% redirect "/" %} will think of a better way, but for parent entries in a structure where they are just used for the structure and need no content, e.g. ABOUT (no content) team history is there a way of redirecting say ABOUT to team? – user2569 Jan 12 '18 at 17:05
1

You know you can do things like this in your root entry template to load it dynamically based on slug or entry type

{% extends [
  'pages/_custom/' ~ page.slug ~ '.twig',
  'pages/_entrytypes/' ~ page.type ~ '.twig',
  'pages/_generic.twig' ]
%}
0

What does each line actually do assuming thats in _entry.twig? and assuming the templates reside in the /pages directory? A brief overview of the functionality would be invaluable :)

  • Say that you have an entry with the type page and the slug slug. It would first try to load pages/_custom/slug.twig - if that doesn't exist it would try to load pages/_entrytypes/page.twig - and, finally, it would fall back to pages/_generic.twig – Fuglsetrampen Jan 15 '18 at 11:52

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.