Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 20 characters in body; edited title
Source Link
Brad Bell
  • 67.6k
  • 6
  • 75
  • 145

craft 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

The URL is set as projects/{projectCat.first.slug}/{slug} Iprojects/{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 urlURL for the first is .com/projects/category/project-name.com/projects/category/project-name.

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

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

and then using routing - /projects/gallery/slug/slug to projects/gallery/_entry:

/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 urlURL and is also a bit messy.

isIs there a better way?

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 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

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?

Source Link
Jerry
  • 21
  • 3

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 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