1

I'm really stuck on a problem that I'm seeking assistance on. I currently have 3 content-types (Article, Photo and Video) and all of them use the same Taxonomy Vocab I've called Category. I've configured the PathAuto module:

  • for Category terms: [term:name] --> CCK Field created and shared across content-types called: field_category
  • for Articles: [node:field_category]/articles/[node:title]
  • for Photos: [node:field_category]/photos/[node:title]
  • for Videos: [node:field_category]/videos/[node:title]

The problem I'm experiencing is having to create a dynamic View page for each term. Basically, if from the root I navigate to a particular category (eg: /politics), I expect to see a page with all content under that term, plus allow me to then filter by content-type.

Similarly, if I navigate to articles under a particular category (eg: /politics/photos), I expect to see a page showing me all photos under that category.

I don't know if I've chosen a very elaborate (and unnecessary!) organisation of content, but this makes sense to me. I'm probably going to kick myself, for I feel that there is a simple solution to this! This is my first time using Views-3 UI, having only minor experience with Views-2 in D6. I'm currently using Views 7x-3.5.

I thank you much in advance for any assistance you can provide!

EDIT: I'm going through whatever online documentation I can find for Views-3, and so far it's quite overwhelming. I do know that I need to use contextual filters and view page paths with %.

1

Okay, I have figured out a solution, although its a bit crude. Before I continue, I should mention that my aim was to also to create hackable URLs.

Installed the Taxonomy_Display module. Created a Content View, and immediately added a contextual filter Content: Has taxonomy term ID with the following configuration:

WHEN THE FILTER VALUE IS NOT IN THE URL:

Provide default value 
    --> Type = Taxonomy term ID from URL
    --> Load default filter from node page, that's good for related taxonomy blocks
    --> Vocabularies = Category

WHEN THE FILTER VALUE IS IN THE URL OR A DEFAULT IS PROVIDED

Specify validation criteria
    --> Validator = Taxonomy Term
    --> Vocabularies = Category
    --> Filter value type = Term Name converted to term ID (got this from the Taxonomy_Display module)
    --> Transform dashes in URL to spaces in term name filter values = Checked
    --> Action to take if filter value does not validate = Show "page not Found"

I then added a relationship: 'Content: Taxonomy terms on nodeon my vocabulary, to give me access to the Taxonomy filters, and added a field filter onTerm = Category` through the relationship created.

Finally, I cloned 3 pages based off the above config, with a page path to categories\%\articles, categories\%\photos, and categories\%\videos, and on each of these added a further filter by the respective content-type.

Well, it does what I want it to, but it somehow still doesn't strike me as an ideal solution ... I think it could be simpler, whilst also allowing for dynamically identifying the content-type from the URL. Therefore, I won't mark this yet as the answer, until someone can critique my approach. :)

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.