Hi,
I am Offline developing a free recipe guide which would provide free recipes. (Using Drupal 6.8, CCK 2.1 and views 2.2)
I have created a content type ONE - INGREDIENTS
I have also created a content type TWO - RECIPE as story with a field "ingredients" & field type as node references of content type ONE with Multiple selection upto ten ingredients allowed by check boxes minimum one is compulsory
Content(s) created as:
Ingredients1 - SALT
Ingredients2 - Sugar
Ingredients3 - Chilli
Ingredients4 - Pepper
Recipe1 - Ingredients - SALT + Sugar (2 Ingredients)
Recipe2 - Ingredients - SALT + Chilli (2 Ingredients)
Recipe3 - Ingredients - SALT + Chilli + Sugar + Pepper (4 Ingredients)
Now I want to display the ingredients list in a block while viewing the recipe. The list would contain link(s) to node of the ingredients with more details about the ingredient(s).
I want to show only the ingredients of the recipe showing on node/page.
I have tried following combinations of settings as:
1. Relationship = Content - Node ref Field (Required)
Arguments = Content - node ref field - Provide default Argument
Fields - Content - Node Ref
Result = A list of 8 ingredients appear in the block.
2. Relationship = Content - Node ref Field (Required)
Arguments = Removed
Fields - Content - Node Ref
Result = A list of 8 ingredients appear in the block.
3. Relationship = Content - Node ref Field (Not - Required)
Arguments = Removed
Fields - Content - Node Ref
Result = A Empty list of 10 appears in the block.
4. Relationship = Removed
Arguments = Removed
Fields - Content - Node Ref
Result = A list of 1 ingredients appear with 9 empty lines. This only ingredient showing does not change with the change of page. The only showing ingredient also appears on the recipe which does not include it (or on the page of recipe which does not has node reference to that ingredient)
Besides these 4 major combinations I also have tried many other possible combinations I could think of.
I have also seen about 15/20 pages on CCK/views on node reference and tried all suggestions.
I have even tried using php codes like args[0]=arg(1) in arguments but that also could not produce desired results.
I am not an experienced Drupal'er. Please suggest in simple terms.
Many thanks in advance,
Comments
Comment #1
merlinofchaos commentedYou need to use an argument, which is set to 'provide default argument' and will provide a 'node id from url'. How exactly you structure this is up to you, but that is the key ingredient that will get the data (the node that is on the page) to your block.