Closed (fixed)
Project:
View reference
Version:
6.x-2.8
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Nov 2008 at 18:41 UTC
Updated:
26 Nov 2008 at 01:43 UTC
I think it would be very beneficial if we could add tokens to the default values when we create the viewreference field. then we could auto assign the NID or other ID's used in the node to be the viewreference arg upon node creation.
Comments
Comment #1
colin_young commentedThis feature would be really useful. Also, tokens to get the current url arguments would be a beneficial addition (e.g. a non-PHP way of getting at the URL arguments), especially if they failed gracefully when the argument isn't present (i.e. just ignore it).
Comment #2
danielb commentedI do not plan to implement tokens myself, I welcome patches, but I feel this is not urgent because:
1) There is already a CCK field module (View Field) which accepts tokens as arguments to display views
2) You can use PHP to achieve the same effect.
Comment #3
colin_young commentedIt's urgent for me :) but I'm happy to try to create a patch, except I think my patch would be for token. I have another post http://drupal.org/node/334634 asking for some help figuring out how to add new tokens.
1) I'm using the View Field module to create a view of type B (view B) embedded in type A, displayed as a view of multiple A (view A), e.g., A1, A1.B1, A1.B2; A2, A2.B1, A2.B2, A2.B3; etc. The problem in this situation is if I provide URL arguments to view A, those arguments don't seem to be available to view B which is embedded in each row of the type As being displayed. There are no tokens I am aware of currently to support URL arguments and AFAIK I can't put PHP into the arguments to view field (it just uses whatever tokens are defined by installed modules, in my case token and CCK).
2) I have not been able to implement my scenario in PHP. I can get the embedded view to show up in the individual node display for A, but as soon as I put A into a view, view B doesn't have access to the NID of A (instead it is getting the NID of the page displaying the view as best as I can tell). It seems like there might be a work-around by using PHP in a theme, but I'd like a simpler solution. It doesn't seem right to me that I'd need to create a custom PHP file for every theme.
In any case, it seems to me like view field is the right module for my specific situation, and I just need to sort out how to add arg0, arg1, ... argn to the token module.
Comment #4
danielb commented