How do you pass page arguments from panels to a view? I'm creating an online store using Ubercart.  I have Views and Panels installed.  I'm using the Page Manager and Panels to configure each of my pages.  I've modified the default view to accept taxonomy terms as arguments.

My question is simple, "How do you pass arguments from Panels to a View?"

I followed the direction's at this URL, but, in the process, actually discovered a much better way (I posted the solution in the article, but I'm also going to post it here):

[a link] http://itscommonsensestupid.blogspot.com/2009/04/passing-arguments-from-panel-to-views.html)

I will post the best solution to this question in a couple of hours.
Example scenario:

There is a panel containing View Content Pane.

Panel URL: /panel_url

Example with argument: /panel_url/term_name

With BEF: /panel_url?category=123

How to set up (having existing panel and added Content Pane):


Add Contextual filter to the View.
E.g.: Views contextual filters taxonomy name
Change settings in 'View -> Pane settings -> Argument input' to load the argument 'From panel argument' (e.g. First).


Done.



In addition, if you're using Better Exposed Filters, you could do the following improvements.

To set the current active link based on the argument (if you're using select_as_links): 

/**
 * Implements hook_preprocess_[themeFunctionName]().
 */
function foo_preprocess_select_as_links(&amp;$variables) {
  $options = isset($variables['element']['#options']) ? array_change_key_case(array_flip($variables['element']['#options']), CASE_LOWER) : array();
  $selected = end((arg()));
  if (array_key_exists($selected, $options)) {
    $variables['element']['#value'] = $options[$selected];
  }
}


To set the current active link based on the argument (if you're using select): 

/**
 * Implements hook_preprocess_[themeFunctionName]().
 */
function foo_preprocess_select(&amp;$variables) {
  switch (arg(0)) {
    case 'panel_url':
      if (@$variables['element']['#name'] == 'DROPDOWN_NAME') { // name of your select list
        $options = isset($variables['element']['#options']) ? array_change_key_case(array_flip($variables['element']['#options']), CASE_LOWER) : array();
        $selected = end((arg()));
        if (array_key_exists($selected, $options)) {
          if ($variables['element']['#value'] &lt;&gt; $options[$selected]) {
            $variables['element']['#value'] = $options[$selected];
          } else {
            // drupal_goto('panel_url');
          }
        }
      }
    break;
  }
}


To make the links SEO friendly, you can try something like:

/**
 * Implements hook_url_inbound_alter().
 */
function foo_url_outbound_alter(&amp;$path, &amp;$options, $original_path){
  if (arg(0) == 'panel_url') {
    // Convert URL like: /panel_url?category=29 into /panel_url/term_name (SEO friendly)
    $path_info = parse_url($path);
    switch (@$path_info['path']) {
      case 'panel_url/term_name':
      case 'panel_url/term_name2':
        $path = 'panel_url/all'; // Convert loopy urls into base url
    }
    if (strpos($path, '?category=') !== FALSE) { // Convert term id into human name
      list(, $tid) = explode('=', current(explode('&amp;', $path_info['query']))); // get tid from URL
      $term_name = strtolower(taxonomy_term_load((int)$tid)-&gt;name);
      $path = '/panel_url' . '/' . $term_name; // See also: $path_info['path']
    }
  }
}