Hi there,
I define uid argument (by php code) to the parent view. However, field view is not accepting that argument. What should I do?
best wishes,
kerem
Hi there,
I define uid argument (by php code) to the parent view. However, field view is not accepting that argument. What should I do?
best wishes,
kerem
Comments
Comment #1
dawehnerWell it worked for me. Perhaps you do something wrong.
Read http://drupal.org/node/571990 to general get help in the issue queue.
Comment #2
keremito commentedHi dereine,
Thanks a lot for your support.
I add "!1" to the arguments section in field_view configuration, as it described there, (but I also added a uid argument to the field_view "Provide default argument" -> "User ID from URL") and the problem is solved. Works perfectly; field_view is accepting parent views argument now.
best wishes,
kerem
Comment #3
dawehnerhehe :)
Comment #4
keremito commented:)
Comment #6
ayukko commentedHi there
I am reopening this issue because I am facing a similar situation. Although I have tried to apply the fix described above, it is quite cryptic to me so I am not able to make it work.
In my scenario, the view referenced in the field_view (this is, the child view) needs a taxonomy term as argument. I have configured the parent view to send the title field of the node, which matches the taxonomy term arg expected by the child. I have tried several options as configuration in the child pane settings-->Argument input but none is making it work. I get no error message but also no records from the child view. What am I missing?
Thanks in advance!
Comment #7
ayukko commentedAdding a small piece of information... as a result of my testings, I have realized the token I am using ([title]) is not being passed to the child view or it is passed incorrectly, not sure how to test this extent. When configuring the arguments section in the parent view, if I enter a hardcoded string that matches the arg type the child view is expecting, it works wonderfully. When I change it to the token, it no longer displays the child view records.
Comment #8
tizzo commentedayukko: could you attach an export of both views?
Comment #9
ayukko commentedThank you for your reply. It made go back and review what I have done and what I was wanting to get as a result from the views. I realized the "issue" was caused by my poor desing and lack of understanding of views (still a newbie). I have redone some parts of the view an now it works just fine, so I am closing this post out.
Comment #10
magtak commentedHello, I am re-opening this issue since I am facing a similar problem. I've used views_field_view before and I know about passing arguments from parent views to child views.
However, I am at a point where the parent view is a content pane, that is accepting arguments from a panel and it needs to pass those (3) arguments to the child view along with an extra one that is defined in the (parent) view but is not present in the URL. So we have a URL that looks like this
user/175/sales/all/2012
where 175 is the user ID
all is a variable that can either be an nid or all to display everything
2012 is the date(year) that I am filtering against
The parent view needs also to pass the commerce order id to it's child view. I've configured the field by passing !1,!2,!3,[order_id], but the child view won't show.
The child views contextual filters are set up correctly since if i enter them in the preview it shows the desired result; so I am clearly missing something in passing the arguments. Any help?
EDIT: By printing out the arguments passed on the view's header and no-body-text in the fashion of !1,!2,!3,!4 I found out that only the [order id] is passed to the child view. Is views_field_view configured in such a way that the parent's argument's can't be passed to the child?
EDIT #2: Tried passing !1, !2, !3 as fields but still no luck, only [order_id] gets passed.
EDIT #3: Tried the next day (today) by passing ONLY the [order_id] and grabbing the other arguments as raw values from the URL. Worked.
Comment #11
damiankloip commentedThis module is not passing any tokens like !1 to the child view, if it's not in the list of available tokens, it's probably not going to work.
Comment #12
dagmarPlease, try the following patch #1439672: Argument tokens are shown but not used. I think it should fix this issue.
Comment #13
damiankloip commentedclosing this in favour of #1439672: Argument tokens are shown but not used
Comment #14
Drupa1ish commentedMy workaround is to use Global null with default value ( for my use case) Content ID from url.
From Global null description
This is exactly what I want: Do not affect the parent view, just pass the content id from url to child view as token !1