Pass the value from the CCK node reference field to the view during content creation

I have an EVENT content type that has 2 node reference fields - BRANDS and STORES. A brand can have several stores and is linked by links to node fields, i.e. the STORES content type has a BRANDS field, which is the node reference field.

When creating an event Ideally, I would like the BRAND field to be autocomplete, and the STORES field to be a selection list. Thus, when I select BRAND, the STORES list will only show stores for that BRAND. Then it’s easier for the user to check the stores where the event will take place

  • Current scenario

When I create an event, the BRANDS field loads all brands. The STORES field loads all stores, even those selected by the brand.

  • What should I do

When I create an EVENT and select a BRAND, I want to load only the stores for this brand in the STORES selection.

An ideal way to do this is to use a view to limit the STORES values ​​based on the selected BRAND. But how do we pass the selected BRAND into the presentation?

It cannot be passed from node, since node has not been created yet, and we cannot get the node identifier from the URL.

Any help with a method to achieve this using views in Drupal 7 would be great!

+4
source share
1 answer

It looks like you need to try the conditional field module . Thus, instead of views, you can determine which fields to display, which fields to hide.

0
source

Source: https://habr.com/ru/post/1439068/


All Articles