If I create a 'page' in Views 2 is there anyway I can assign a taxonomy to that 'page'. As blocks on that page need a taxonomy to display things correctly.

Comments

alan d.’s picture

One possible workaround would be to use the module insert_view and create a page that has the view embedded into it. The taxonomy can be assigned to the container page.


Alan Davison
www.caignwebs.com.au

Alan Davison
jdelaune’s picture

thanks alan. I thought that as well but I need to pass arguments from the URL into the view and that doesn't play nice with pathauto. Any other ideas?

alan d.’s picture

Sounds like it's a bit more complex. So creating a page per view argument is off the cards?

Maybe have a look at views_get_page_view and a preprocess function to set up the taxonomy based theming. Pseudocode follows;

<?php
/**
 * Override or insert PHPTemplate variables into the templates.
 */
function phptemplate_preprocess_page(&$vars) {
  // ...
  // try and get the view
  if ($view = views_get_page_view()) {
    // Not sure if $view is an object or string
    if ($view->name == 'xyz') {
      // update the relevant variables
    }
  }
}
?>

If this fails, my thoughts move to a custom callback, but I'm not sure what your level of experience of this would be. It would involve a menu callback that triggers a function similar to that used in insert_view and capture the real page arguments and pass that to the view. (I've only done similar things in D5 Views).

Hope this helps


Alan Davison
www.caignwebs.com.au

Alan Davison