Skip to main content
2 of 2
added 20 characters in body; edited title
Brad Bell
  • 67.6k
  • 6
  • 75
  • 145

Craft 2 use different template for the same structure

I have a site with projects which each has a projects structure with an associated category and a number of images.

The URL is set as projects/{projectCat.first.slug}/{slug}

I want to use the structure first for a set of thumbnails for each project (easy - no problem) and then for a gallery page with full size images. Both pages will have the same set of images. The URL for the first is .com/projects/category/project-name.

The only way I have been able to do it is to make the links from the thumbnail page using:

<a href="/projects/gallery/{{ category.slug }}/{{ entry.slug }}">

and then using routing:

/projects/gallery/slug/slug to projects/gallery/_entry

This works but if I have a project in two or more categories with the same name it doesn't take account of the category in the URL and is also a bit messy.

Is there a better way?

Jerry
  • 21
  • 3