Posted by blavish on November 15, 2010 at 10:42am
Hi
We have a fairly large news site. We make pages where all the news of each topic is located for instance /topic
The problem is that we use a page then we create views from a certain term and put those views in there, so we have about 100's of topics with its own terms. This causes us to make 100's of views to put in each page.
Is there a easy way to get clone the pages and just change the term once to the new page's term?
for instance, i have /japan then i can change change the term somewhere and it will all be switched to /china so i dont have to create 100s of views for china?
Comments
Yes
Here are the basics:
We have just a few standard views. They might have several displays each, and nearly all of them accept optional arguments.
We also use Panels as taxonomy term overrides for section fronts, with a variant panel for each section. This lets /sports and /outdoors have different layouts. Using the overrides instead of free-standing pages cleans up the back end and prevents the sports and outdoors taxonomy pages from ever displaying, while terms that don't require special layouts can default to a standard term page.
Hi Yelvington Thanks a lot
Hi Yelvington
Thanks a lot for your reply I figured all parts out except this part
"Place views on the override page, passing the term as an argument to the view"
Please explain how i can do this. Do you mean i should enable the term_view in panels?
Thanks!
Yes
Yeah, that's the one -- you go to admin/build/views and there you can override existing pages.
Some screen shots of how we've built our section fronts as tax term overrides:
http://www.flickr.com/photos/yelvington/sets/72157625271730061/
Same principle would apply to any other vocabulary, such as Topics. You could have a generic page and as many special cases as you like. Views could pull in not only stories, but images, a synopsis, et cetera, by sharing a vocabulary among multiple content types.
I tried just about
I tried just about everything, I am just stuck with this "Place views on the override page, passing the term as an argument to the view"
I am not sure how to get those "arguments" to work, i cant figure out what numbers to put there.
Thanks for the help
Nope still not. I got
Nope still not. I got halfway. I got everything filled in as should be. In Arguments i said %term. Unfortunately when i go and view a term then nothing displays.
To pick up arguments ...
Your panels page should include one or more views panes that accept two arguments:
Taxonomy: Term ID (with depth)
Taxonomy: Term ID depth modifier (term and depth).
When you place the panes, pass %2/%3 as the arguments in order to get the term and depth from the URL. Ignore the aliased path. The "real" url of the page is /taxonomy/term/tid/depth, and you want to skip args 0 and 1, passing 2 and 3.
Your panels page's title can be %term:name, which gives you "Term(s) being viewed: Term name of first term."
The only time you need to pass literal argument values is when you want to display something other than the natural arguments. We do that, for instance, to display letters to the editor on the opinion page.
Thanks
I finally got it working with your last explanation. I cloned the default term view and messed around with that until i understood those arguments you talked about.
Thank you!