Attached is a patch that makes the global tokens provided by the token module available to the nodereference module in the advanced data settings in the field configuration form.
The change allows you to change which nodes are presented to the user contextually. I'm using it to allow users to reference only the nodes they created.
The patch introduces two simple changes to the 5.x-1.6-1 version of nodereference.module. It adds some help text to the field configuration form, and it adds the token_replace function to the processing of the arguments submitted by that form.
The patch applies to 5.x. I have no idea if it would be compatible with 4.7.
Comment | File | Size | Author |
---|---|---|---|
#3 | nodereference-tokens-advanced-views-arguments.patch | 3.33 KB | noelbush |
#1 | nodereference_d5_tokens.patch | 1.87 KB | WorldFallz |
nodereference_3.patch | 1.72 KB | nicholas_w |
Comments
Comment #1
WorldFallz CreditAttribution: WorldFallz commentedrerolled patch against the current DRUPAL-5 branch. changed token delimiters to '[' and ']' to mimic the delimiters used by the viewfield module. Works as expected-- powerful extension to nodereference module.
Comment #2
yched CreditAttribution: yched commentedPlease merge efforts into #196518: Token support for advanced view argument (patch for CCK D6, will be backported when the D6 version gets in)
Comment #3
noelbush CreditAttribution: noelbush commentedThe patch in #1 did not go far enough for me, because it only provides access to "global" tokens (like site name). So the attached patch (against the latest Drupal 5 release of cck/nodereference) provides access to node information and fields.
Sorry, this is for Drupal 5 -- there are still a few of us using it. ;-)
Comment #4
betz CreditAttribution: betz commentedany drupal 6 version?
This is exactly what i need also
Comment #5
adam_b CreditAttribution: adam_b commentedunsubscribe - found duplicate ref