So the word is that the Token Module has been incorporated into core. That's great, but...

  1. There doesn't appear to be a Token feature in the modules list to either enable or disable; so I assume it's always turned on? I don't know...
  2. Whereas in D7 there were numerous "helper functions" wherein I could look up the right token to use in a given field or instance, in Backdrop these are often nonexistent. Is there a helper module for this?

As a kind of half-coder/half-builder, I feel a little left out here. What happened to the fairly excellent Token Assistance that was there in D7?

Don't get me wrong: I'm a die-hard Backdrop enthusiast, but there seems to be a dropping of the ball here... 

Where can I get the Token information that I need? Where are tokens thoroughly documented? Please help.

My current situation: I want to pass a parameter (an argument) to a view in the Views Field. I have child nodes containing node references to the parent node in which I have a views field, but the UI in the field setup says "Enable the Token module to see a complete list of tokens that may be used as arguments." —Okay, I assume this verbiage is a carryover from a D7 version of the Views Field module, or something. But of course there is no Token module, so I am at a loss as to how to format my entry in order to pass the NID of this parent node to the View. I've tried  %nid and [nid]... No joy.

Any help is much appreciated. Thanks in advance.   —Eric

PS: the links provided at https://api.backdropcms.org/api/backdrop/modules%21examples%21token_example%21token_example.module/group/token_example/1 appear to be broken (no longer existent) so some editing in that documentation might be in order...

Comments

Okay...!

I discovered the answer for my immediate situation. The answer is this:

[node:nid]

This did the trick for my immediate situation. Nonetheless, the overall gist of my request remains... Is there a central clearinghouse of tokens, or must we always seek, search, and find the answer by trial and error? I'm guessing that the info exists somewhere, but perhaps it needs to be finally put into a central database...

But since I don't really know how the token mechanism works, I wonder if tokens are generated by a central authority, or if modules are able to "make them up on the fly"... In the latter case, then centralized documentation of them will be nearly impossible...

I remain curious.

Cheers, —Eric

klonos's picture

Sorry for the late response on this one ericfoy, and thanks for taking the time to follow up with a comment to explain what the solution was in your case.

Yes, the Token module has been merged into the System module (and other respective modules) in Backdrop core version 1.1.0, back in May 2015; so it is "always on", and there's no separate module for it. For details, see this issue in GitHub, and the respective pull request that was merged as part of that issue.

I am not familiar with this "Token Assistance" that you are referring to; is that a contrib module? I've tried looking it up, but my google skills are failing me today 😅. Can you please provide more info and/or links? ...the only thing that I can imagine you may be referring to is the "Token Browser" which is available in Backdrop core, for example:

...perhaps this token browser has not been enabled for the field you are using(?).

Also, you are referring to the Views Field module (that being https://www.drupal.org/project/views_field, right?) but I was not able to find its port for Backdrop in https://github.com/backdrop-contrib (if it has been ported, and I'm just not able to find it, I'll be really disappointed in myself - I must be getting old and my searching skills rusty 😅). Are you perhaps using the D7 module as is? If so, then the reference to the separate Token module is expected, as it was not included in Drupal core as is the case for Backdrop.

I've created https://github.com/backdrop/backdrop-issues/issues/4490 so to keep on our radar to fix the "placeholder" links in our API documentation. Thanks for bringing that to our attention 🙏