Individual landing pages for taxonomy by category

Hi there,

I am probably just stuck and unable to wrap my mind about the following issue, but I am positive that somebody can shed some light on it :slight_smile:

I am building a company website, that is a mixture of plain information about the company + a showcase of already concluded projects. This showcase of projects is currently a page collection that shows a list of flashcards, one for each project (or simply imagine a page collection of blog posts, with one flashcard for each post, like in the blog skeleton).

So folders and markdown files are organized like this:

../user/pages/02.projects/projects.md (= simple page collection)
../user/pages/02.projects/first-project/details.md
../user/pages/02.projects/second-project/details.md
../user/pages/02.projects/third-project/details.md

Now, each project in its details.md frontmatter has some taxonomy with an assigned category; for example, first-project and third-project belong to category: branding, while second-project belongs to category: website.

projects.md is showing all projects, without distinguishing the category (and this works fine, with pagination and all).

I’d like to have an individually landing page for each category, so that for example I can get flashcards only for branding. For that I created

../user/pages/02.projects/branding/projects.md (= with taxonomy collection for branding)

That works well, too, except for the links in the pagination: instead of creating links like project.url/projects/branding/page:2, the link to page 2 justs point to project.url/projects/page:2 (without branding), which leads to showing all projects from all categories, once I click a pagination link. I understand the technical reason for that, but this does not solve my problem of getting individual landing pages for each specific category.

Now, I just could work with ../user/pages/02.projects/projects.md and filters like project.url/projects/category:branding, which solves the issues of links in pagination (link to second page is project.url/projects/category:branding/page:2), but this would not allow me to have individual landing pages.

So, any good ideas on how to make this work? Just in case: one project could belong to different categories. E.g. forth-project could belong to category: [branding, website]

Thanks in advance!

Regards,
Sebastian

@sklus,

You said:

[…] instead of creating links like project.url/projects/branding/page:2, the link to page 2 justs point to project.url/projects/page:2 (without branding), […]

I cannot reproduce this using fresh skeleton of Blog Site (download):

  • Copy /user/pages/01.blog/blog.md into /user/pages/01.blog/01.photography
  • Replace items and limit with:
    items: 
      '@taxonomy.tag': [photography]
    limit: 3
    
  • In pagination section, url of page 2 will be http://blog-dev/blog/photography/page:2

You are right, @pamtbaau

I just checked out the link you sent and what you state is correct.
To crosscheck, I did the same with the typhoon theme + skeleton (which I am using) and there is where the problem occurs.

I’ll sit down later to see if I can find any differences in the templates / partials or config that causes this behaviour and report back.

Thanks for the lead!

Regards,
Sebastian

1 Like

Here is what I’ve found so far:

When dumping base_url from the pagination twig, in Quark, it returns /blog/photography.
However, when dumping base_url in Typhoon, it returns just /.

Now, in both templates and its corresponding pagination.html.twig, base_url is set as

{% set base_url = base_url|default(page.url) %}

Why it returns in Quark the complete URL and in Typhoon just the root, that I do not know.

Sebastian


EDIT: Got it!

Typhoon has a parameter in the skeleton’s blog.md that is called root_of_blog and that in my case was set to true. I am not sure what it does exactly and have not found any documentation on it, but removing it (not even setting it to false) reestablished the desired behaviour.

Thanks again @pamtbaau for pointing me into the right direction.

1 Like