1

I have a taxonomy of region names, and a content type of products. Each product is referenced to a region. I am attempting to create a single view that would show the products for a given region based on the url. For example, http://www.mysite.com/[region-name1]/products and http://www.mysite.com/[region-name2]/products should display products referenced to those specific region. Right now I have the view path set to /%/products, and a contextual filter set, but when I attempt to view the products, I get page not found. (It does work when I am previewing the view).

It works when I set the view path to [region-name]/products for a specific region and don't use a contextual filter, but I am trying to avoid having to create a view for each region if there is a way that I can do it once for all regions.

  • Are you working with a page view or a block? Also, please give an example taken from your URL after the domain and clarify if you have validation set in the contextual filter and any settings you have used. – Ashlar Nov 7 '11 at 19:49
  • I am working with a page view, an example of URL is: /new-york/products OR chicago/products, and I have specified a validation criteria: Taxonomy, with a filter value type of 'Term name converted to Term ID' and I have checked 'Transform dashes in URL to spaces in term name filter values'. – Baumer Nov 7 '11 at 19:56
  • Damn, it looks right. We need to examine the input for the filter. Try an override title of %1 and preview the view. It should give you a first line in the preview of exactly what it is getting as the contextual filter. – Ashlar Nov 7 '11 at 20:07
  • It does not display a title. i just get: Page not found The requested page could not be found. I think that a URL alias might be interfering here. (I have the Action to take if filter value does not validate to display all) – Baumer Nov 7 '11 at 20:23
  • Can you please publish the view export. I haven't tried wading through one before so there is no time like the present. The export option can be found on the View form top left side down arrow as one of the options under "Edit view name/description. Just copy and paste it in a new answer. – Ashlar Nov 7 '11 at 22:19
1

I'm not sure if this is too late or not, but I managed to do this exact thing. You need to create a relationship for "Content: Taxonomy terms on node," putting in the given vocabulary you're using. You then make a contextual filter based on this relationship. Mine looks like "(term) Taxonomy term: Name."

Hope this helps. I struggled with it for quite some time, as well.

1

Arguments don't seem to work in the first position. So /%/product won't work, but /content/%/product will. Just move the argument to at least the second position and all should be fine.

0

have you checked this link yet? I think i had a similar problem.

D7 views 3, display content based on path

  • Thanks, I have seen this, but it does not discuss adjusting the path in the view's page setting. The difference here is that my argument is not at the end of the url, but rather I am trying to use the 1st argument in an existing url to determine what is displayed. – Baumer Nov 7 '11 at 20:00

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.