0

I created a view block that displays in table where there is an exposed filter called category:

Category | Data 
A           1
A           2
B           3
C           4

now I want to create multiple html links where their url points to a page where this view block is displaying.

However in this page I only want to display the data view where certain filter is activated

example:

Link 1 > url points to page x with view only showing items with category A Link 2 > url points to page x with view only showing items with category B

How do I create a url for views that displays values using exposed filter?

0

I think you want to use a contextual filter, not an exposed filter. The contextual filter will take an argument (such as the category term id or node id, depending on whether it's a taxonomy term or a node) and filter out all other nodes.

  • But they might want users to be able to interact with the exposed filters also, in which case arguments are no use. – rooby Apr 21 '13 at 5:12
0

Go to your view with the exposed filters and select the filters you want and submit. Notice in the URL now there will be your exposed filter values, which will look like this:

yoursite.com/page-path?exposed_filter_1=filter_value1&exposed_filter_2=filter_value2

Then you can copy that url and make a link out of it elsewhere.

If your link has the ?exposed_filter_1=filter_value1&exposed_filter_2=filter_value2 part on the end then the filters will be set when you click the link.

  • My problem is the view on the page is a block view not a page view so it doesn't generate any url... – ARGO Apr 22 '13 at 2:41
0

Edit the view, click on the exposed filter. Look at the "Filter identifier" field, use the value of that field in the url.

If the Filter identifier says "type", the path you have placed the block on is "path", and the category id is 1, the url will be http://example.com/path?type=1

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.