1

I have a content type of Product which includes a text field for the user to enter a Brand. This text field is open to the users to enter correctly, as there are hundreds of brands and I don't want them to have to learn how to enter taxonomy terms.

I am wondering if there is a way to dynamically create a View that will also dynamically generate the page name and page URL depending on the brand, and then display a table view of all of the Products with that Brand.

So for example if I have /category/brand/product-name as the parameters for the URL, for a specific product it would be /tshirt/busted/open-road, and with Busted being the Brand entered by they user, the view would automatically create the /busted url, and populate it only with Busted brand products in a table view.

Is this possible? I was thinking perhaps I needed to use tokens to grab the [node:field_brand], but I am unsure exactly how I would do this, or if it was even possible. Also, if there is a better way of handling this data instead of a textfield, I would like to know!

0

I think you can still use taxonomy for this. The taxonomy can be open ended not need to make it closed to the terms you define.

When you add a taxonomy reference field choose the widget as autocomplete this will enable the user to add their own taxonomy term which may not be there in the list already.

If you are very particular about using the field then you can use that a contextual filter in a view so that it would appear in the url as mentioned.

  • I am unclear as to how I would use taxonomy terms with my current setup. My Product content type has these fields: the Category is controlled by a list, as there are only 7 categories that it can be. My Brand is the textfield for user input, and then the Title of the node is the Product Name. The Product content type is then stored at the url using URL paths to the fields using tokens of [field_category]/[field_brand]/[content-type]. Is there a better way to handle all of this categorization so that I can get the desired result of custom views pages at all three levels-category, brand,product? – codeadventurer Jan 20 '13 at 18:56
  • Sorry, I meant is there a better way to handle all of this categorization so that I can get the desired result of custom views pages at two levels- both /category, /brand and then the view will create a table listing the appropriate products? – codeadventurer Jan 20 '13 at 19:04
  • What I ended up getting was something close, but still not working in one area. I changed my Brand from a textfield to term-reference with autocomplete widget, and I've gotten the view to contextualize for the field_category (which is a list), but when adding a second contextual filter for [field_brand], I am not getting the expected behavior for the URL found at [field_category]/[field_brand]. Is it not possible to have two contextual filters? – codeadventurer Jan 20 '13 at 22:32
  • Because I couldn't figure out the problem with having two contextual filters, I decided to create another Page within my view that has a path of /taxonomy/term/% -- this will just then take people to brands/[specific_brand_term] and here I have created my view of all the products within that brand. – codeadventurer Jan 20 '13 at 23:40

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.