I'm playing around with the latest Views module (beta3) and the default taxonomy view supplied with it. I'm wondering if there is a way to present a unique header for each taxonomy view? The specific taxonomy term is supplied as an argument, but I don't see an obvious way to create a unique header for each one, aside from creating a view for each taxonomy term I want. That doesn't seem good :) The other alternative is to keep the view as is, but then to create a page for each taxonomy term, supply the header, and then insert the specific view into the page.
I'm wondering what others have done in this case? Is there a recommended approach, or do I just find something that works and stick with that :)
Comments
Me too
Hello, i'm trying to do the same thing. I'm just starting it, so if I find anything out I will get back to you
php code
The best way is probably to write php code for the header of the view. The code can take the argument from the view (e.g. the term id or term name), and then you can use that information to do lots of things. Since each taxonomy term's view would have its own associated argument, the code could return a different header for each term.
-Mike Goodwin
http://www.not2us.net
http://www.redleafmedia.com
Thanks! I think that will
Thanks! I think that will work. What's the best way to find out what variables are available at the time the code is executed?
example
The arguments from the url are pretty easy to get.
I'm not sure the best way, but you can see the argument by using some simple code:
Make sure to set the input format to "PHP Code". Something like this would just print out the first and second arguments from the url. You have to find which argument number you want to use, then use that variable (e.g $argument1 or $argument2) to write further code. Does that make sense?
-Mike Goodwin
http://www.not2us.net
http://www.redleafmedia.com
Yes :) I realize I can use
Yes :) I realize I can use the arg function, but I was just wondering if there was a way to know what other additional variables are around. Something like this can be done,
print_r(array_keys(get_defined_vars()));
Thanks!
Views title field
There is a title field for each argument which you can use to set the title of the view if the argument was present. views6.x 2.2
hey guys, so i want to print
hey guys,
so i want to print a different header for certain taxonomy terms:
I tried the following:
but it just prints the message for all taxonomy terms (not just term 1 taxonomy terms)
Any suggestions?
regards
Ok, i figured it out: <?php
Ok, i figured it out: