1

I have some taxonomy vocabularies that are used on different content types (blog posts, images, businesses etc.).

I want to create a main page for each content type listing, and filter those listings by taxonomy terms, creating multiple aliased pages.

For example:

  1. BLOG:

    • main blog page listing all blog posts and some related blocks @ /blog
    • blog sub-pages for each vocabulary/term listing blog posts with that term @ /blog/vocabulary/term
  2. ACTIVITIES:

    • main page listing all businesses @ /activities
    • activities sub-pages for each vocabulary/term applied to the businesses @activies/vocabulary/term

The problem I am having is to have aliases and metatags set automatically using the taxonomy data.

I would like "content-type/vocabulary/term" (not "vocabulary/term/content-type"), and to still be able to use "vocabulary/term" (default Views or Panels taxonomy term templates) as general pages listing all content types.

Is this possibile?

1

The problem with dynamically creating every page is with the "content type", Drupal does not support dynamic arguments (wildcards) as the first part of a path, so there really isn't much you can do about that.

But let's approach it a little different, actually you should be able to use the taxonomy view that comes disabled with views by default to achieve what you are looking for, I would create a new page and:

  • enable it
  • create a contextual filter "Content: Type"
  • add relationship "Content: Taxonomy terms on node" and require it
  • add contextual filter "Taxonomy vocabulary: Machine name" using the relationship
  • rearrange the contextual filters: "content type", "vocabulary", "term id(with depth)", term id("depth modifier")
  • edit "Content: Has taxonomy term ID (with depth)", in the section for "WHEN THE FILTER VALUE IS IN THE URL OR A DEFAULT IS PROVIDED" change "Filter Value Type" to "term name"
  • edit the path for the page (browse/%/%/%)

save your view and that should do it.

Again, remember that we can't use a dynamic path argument as the first part of a path in drupal which is why I added "browse".

  • Thanks for the fast reply! Will I be able to use the taxonomy terms metatags on those pages? – kopeboy Sep 30 '14 at 15:31
  • I'm honestly not sure, I haven't ever tried... are you using metatags provided by a module? – Trey Sep 30 '14 at 15:34
  • I'm using metatag module. I am trying to make the view, still no success, updating asap – kopeboy Sep 30 '14 at 15:39
  • Ok. The page exists, with the right path, but no results are shown (while there is content with terms).. Also, no metatags are set. – kopeboy Sep 30 '14 at 15:50
  • I just walked through with the exact instructions above on a new installation and it worked fine. – Trey Sep 30 '14 at 21:10

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.