I need the view to return a list of nodes by a certain node id dynamically.

I have a content type called 'subject' which can contain other content types called 'article' by node hierarchy.
So far so good.

I have added a field to subject so you can choose the default/main article for that subject.
I've done this with cck-field 'node reference' and choosed content type 'article'.
So far so good.

But I don't want to be able to choose from articles which belongs to another subject.
I Saw an option to use a view to return the nodes for you. That will do it I thought.

I go into the view and select 'node hierarchy-parent node'.
Aaah that's exactly what I needed I thought.

BUT you can not choose something like where parent node is:
"the current node you are editing".

It's just a text field which becomes a string in the sql query... I hoped I could write '$node->nid' or something.

So, how shall I do to dynamically get the nodes which parent is the node I'm currently editing into my cck-node reference drop down list?

(off-topic: When I choose Project 'Views' I cannot choose any component)

Comments

damien tournoud’s picture

Project: Drupal core » Views (for Drupal 7)
Version: 6.2 » 6.x-2.x-dev
Component: other » Miscellaneous

Please attribute your issues to the project Views.

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

I either need you to write more coherent English or I need someone who can understand you to translate for me.

Mattias Holmqvist’s picture

I have a field in a content type which is of type "node reference".
You can filter the nodes allowed in that select field by content type.

So, now I have a select field containing ALL nodes of the content type I filtered by.
That is not want I want. I want the nodes showing up in the list of my special content type to be childs of the node I'm currently editing.

Example of content types and their hierarchy structure:

"Article Container"
"Article"

In "Article Container" I have this select field called "Main Article" so I can choose the main article for that container.

So I don't want child nodes of other article containers to be chooseble for all article containers.

"Article Container 1"
"First article of article container 1"
"Second article of article container 1"

"Article Container 2"
"First article of article container 2"
"Second article of article container 2"

When I edit Article container 1 I only want childnodes of that node to appear in this select list.
This is basic functionality in a CMS but seem to not be included into Drupal core.

Maybe some module supports this or do you know how I do this?

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

You may have wanted the nid as an argument - this issue is more than a year old, with no further updates. Going to close it out.