1

I have 2 views.

View 1 is a small exposed form which collects some data and has some contextual filters.

View 1 is linked to View 2, so when the form is submitted the form redirects to View 2 and inserts the collected data as contextual filters in the url.

The fields in the url are in the form of module[module_field] but they are printed as module%5Bmodule_field%5D in the addressbar in the browser when View 1 redirects to View 2.

But opening manually the same page with the decoded version module[module_field] works. How can I prevent View 1 to urlencode the parameters for the contextual filters?

0

You need to use theme_links() function in template.php file of your theme. The original theme_links() function has this:

if (isset($link['href'])) {
  // Pass in $link as $options, they share the same keys.
  $output .= l($link['title'], $link['href'], $link);
}

You should replace it with this to undo the encoding:

if (isset($link['href'])) {
  // Pass in $link as $options, they share the same keys.
  $link_html = l($link['title'], $link['href'], $link);
  // Decode the link HTML before adding it to the output
  $link_html = rawurldecode($link_html);
  $output .= $link_html;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.