I would like to do exactly what the standard "Node view: taxonomy_term" does except I would like to change the template based on the term content type.
I use certain taxonomy to categorize different content type and when they are displayed I would like them displayed differently to the user.
So if I have:
http://www.example.com/content-type1/vocabulary/term/term/term
I would like to show a list view.
Or if I have:
http://www.example.com/content-type2/vocabulary/term/term/term
I would like to show a teaser view.
I have tried many different configurations and cannot come up with any way to do this. I would appreciate any help.
Comments
Comment #1
merlinofchaos commentedViews doesn't do this. You probalby want to use taxonomy redirect to point different vocabularies at different Views.
Comment #2
Cactii1 commentedThanks merlinofchaos.
I'll take your word for it since you probably know a little bit about this module hey ;)
I appreciate the support.
Comment #3
Cactii1 commentedMaybe I just need to approach this differently.
I know what the URI will be for my content types so I should be able to just if/elseif/else through. The document URI contains the content type if I can retrieve it from there.
Views can give me all the fields I need unformatted, I can use the ones that I want and ignore the rest, I can use the template file to lay everything out.
Merlinofchaos... I know it is a lot to ask but do you think you could help get me started on a little bit of the pattern matching code that I would need to be able to do this?
I'd just have to get the document URI... rip off the http://www.example.com and return everything in between the / and / that is left over and ignore the rest.
I know you're a busy guy but just an outline and I could probably stumble my way through the rest.
Thanks in advance if you think you can help.
Comment #4
Cactii1 commentedOk so here is my partial solution (I call it partial because I haven't tested it yet) - be aware that there is nothing automatic about it and you'll have to set this up manually for each separate content type that you want to format differently in the view.
At the top of the template file for the view that I am using I am putting the following code. You url needs to be formatted a certain way for this to work.
Views style should not format the view and you need to tell Views the fields that you want to use so that you will have access to them in the template.
http://www.example.com/content-type/vocabulary/term/term/term