Closed (fixed)
Project:
Token
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
18 Nov 2010 at 02:58 UTC
Updated:
23 Jan 2019 at 04:14 UTC
Jump to comment: Most recent, Most recent file
For instance, we want the 'book page' token type to extend the 'menu item' token type, but also add its own 'bid' token that does not apply to all menu links.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 975112-token-extend-types.patch | 7.84 KB | dave reid |
Comments
Comment #1
dave reidThink I've actually got this. I thought I'd have to do a whole bunch of token type dependency parsing and graphing, but I don't think that it's likely we'll have a two-deep token type dependency. If so, I have some code ready for that.
Comment #2
dave reidComment #3
dave reidSweet!!! Committing #2 to CVS!
http://drupal.org/cvs?commit=466256
The example we provide is we want [current-user:ip-address] to return the IP address of the current logged-in user, but [user:ip-address] should not be provided as we have no idea what a single user's IP address is.
If ever this needs to resolve two levels of token type dependencies, here's the code I had started writing:
Comment #4
sbrattla commentedJust wanted to follow up on this one, as I believe it is closely related to something I've run into.
I've defined a token 'sender' in my hook_token_info() the following way:
What I would expect is that the 'sender' extends 'user', so that all tokens available for a 'user' is available for a 'sender'. When I open up a token browser, this proves to be correct. All tokens which would be available for a 'user' is listed as available for a 'sender'.
However, it seems to stop with that. Tokens available for a 'user' appears to be available for a 'sender' as well (as the token browser says so), but no [sender:X] token is being replaced at all.
I'm uncertain if my issue is related to this issue?
Comment #5
chris matthews commentedThe patch in #2 was committed 8 years ago so changing the issue status to fixed.