Questions tagged [tokens]

Use it for questions related to the Token module, or a similar form of token replacement system. Don't use it for authentication tokens.

Filter by
Sorted by
Tagged with
1
vote
1answer
494 views

How do i generate token for each user they submit my custom form?

I have a created a custom module with simple form with only three fields ( Url, title & email ) , where user has to enter all the fields for submission. I am able to send the mail to the user ...
1
vote
0answers
18 views

Guidance on entity reference - tokens or token parsing tools suggestions?

I have 3 content types - Organization, Site and Station. Stations related to a Site. Sites related to an Organization. A user can update is 'location' to show where they are working that day. I use a ...
2
votes
1answer
545 views

Rule to send an e-mail with the URL of an uploaded attachment after node change

I have a Drupal 7 site with a custom node type with a custom attachment field. After a (kind of this custom) node has been published, I got an e-mail with the help of Rules module. I would like to set ...
3
votes
1answer
693 views

Using token in page.tpl.php?

I downloaded the social media module and I found this token: [socialmedia:sm-twitter_username]. I want to show it where the Read more / Add new comment section is, under an article. Since I can't find ...
1
vote
3answers
390 views

How do I collect field values of a submitted webform?

I'm trying to integrate a Mailchimp mailing list into Drupal. The Mailchimp list requires: First Name Last Name E-Mail The client already has a list in this format so ideally I need to collect this ...
1
vote
0answers
20 views

Token to output the last value in a multi-value field?

I have a text field in an Entityform set to accept an unlimited number of values: I'm trying to build a Rule that sends an email with the text from the last submitted value from the field. The token ...
1
vote
1answer
1k views

How to use node field tokens as a value in Metatags module?

I am trying to optimise SEO on my site by ensuring that each page has a unique value for descriptive metatags. I am trying to achieve this using the Token and Metatags modules, and am using Drupal 8. ...
0
votes
1answer
629 views

Rules token one-time-login-url is showing up empty

I have a rule that, after submitting a webform, a user gets created and then sends two emails to that user. One saying their form data is being looked at by someone for review before they get a ...
1
vote
1answer
37 views

Cannot get just the text of an option from submitted data

I'm using Webform 8.x-5.8. I've got a select box referencing some content. Of course, the numeric option value is passed. But when I reference submitted data with tokens, I just want to handle the ...
1
vote
3answers
679 views

How can I get the group id of a node using tokens?

I try to use [node:og_group_ref], but that gives me the group node title and I need the GID, I am sure there should be a way to get it but I haven't found it
0
votes
1answer
832 views

token_filter module: [node:nid] for custom block?

Drupal: 8.1.7 Module: token_filter 8.x-1.0-beta1 I have a custom block with a Text format that has Global and entity tokens are replaced with their values enabled. The custom block has this value: ...
0
votes
1answer
599 views

Getting a custom field to appear correctly in Rules using entity form module

I have written a custom field widget called foo which is inserted into an entity form to provide an autocomplete to another web service. I am trying to get the field data to be sent in an email via ...
0
votes
1answer
134 views

Token for user being viewed

I am formatting the user profile page in Drupal 8.9.2. Are tokens available for the user being viewed (in user profile page), to display the user information? I am using the Token and the Token Filter ...
1
vote
2answers
907 views

Custom tokens in custom module

The story : I create lets say a simple module to store input data and sent a mail when you click save. Now i done the part of store data, send mail and retrieve data, but i would like to add tokens ...
1
vote
3answers
930 views

“[node:flag-vote-count]” displays the token name, not the number

I have a problem in the Flag module with the [node:flag-vote-count] token. I googled for a solution, but I couldn't find one. On my content page, the Flag module displays the token name (i.e. [node:...
3
votes
2answers
2k views

Conditional token pattern

I am looking for a module or a hook that allow me to use if conditions with tokens. For example I want to check if a field is equal to a specific value or text [if][field_name][eq]hello[then][...
3
votes
2answers
3k views

Android submission: I get a “CSRF validation failed” error while using a cookie

The Drupal Version is 7 and the Services version is 3.4. So, My login into Drupal goes like this: Fetch a token. (POST) Fetch a Cookie using the token. (POST) Make GET Requests using ...
0
votes
0answers
9 views

In the D8/D9 webforms module, what is the correct sytax to rename an uploaded file using tokens?

I am building a webform. I have a name Field that uses first and last name. I have an image upload field where I want to rename the image to lastname-firstname.jpg. In the properties for the file ...
0
votes
2answers
1k views

Token replacement for list keys

I'm trying to define a Display Suite Code Field which would be responsible for converting a list item key (selected in a dropdown on admin side) into an image on the output side. The field simply ...
0
votes
2answers
2k views

Grab Node ID from URL of Current Page?

How do I grab the Node ID in the URL of the current page and pass it through a link? 1) The URL on the current page is in the format: website.com/parameter/parameter/parameter and the third ...
0
votes
1answer
349 views

How can I use tokens for Addressfield values without using Addressfield_tokens?

I would like to use the Town/ City field as a token for Pathauto. I thought the Addressfield_tokens module was perfect for this, but Entity Tokens breaks Pathauto's patterns control panel; the issue ...
3
votes
2answers
405 views

Custom Path Alias with Initial Letter as Token

For various reasons, I need to change my custom path alias for a taxonomy type as follows... FROM: /composers/aardvark TO: composers/a/aardvark So I'm looking at either creating a custom token, or ...
0
votes
1answer
361 views

“&” displaying as “&”

I'm Using File (Field) Paths “&” displaying as “&” in the file name i tried to solve it by change the the display of the field to plain text and use the token view mode but nothing change ...
1
vote
1answer
366 views

Send email with custom tokens on event?

I am trying to make a rule which when acted upon will send an email with custom details based on the rule arguments. I made my rule event and that's all working fine it shows up, but when I add an ...
2
votes
2answers
1k views

How do I add a custom field token to a default value?

I want to add node-field data into the web from block via tokes as with Webform 7.x-4.1 this should work. But tokens from custom fields are not available in a webform(block) ? [node:title] and [...
24
votes
6answers
21k views

How to programmatically create a custom token in a module

How would you go about programmatically creating a token? I wish to add some custom tokens for my module.
1
vote
1answer
396 views

How do I access the first value of a multiple value text field using replacement patters inside a rule?

For example, lets say I have a list of objects each stored as separate values of a text field. How would I access the individual values? I have tried using delta and I have tried using entity token ...
1
vote
1answer
368 views

how to use tokens as “views filter criteria” for a custom table?

I created view for fields from a custom table using handlers. I need to create a filter so that only the users who created the data can see the data. how can I create the filter?
0
votes
1answer
725 views

Some tokens show as “missing name or description” in status report

Looking at a Drupal 7.43 maintenance project, my status report lists the following issue for Token 7.x-1.6: The following tokens or token types are missing required name and/or description ...
0
votes
1answer
606 views

Twig Tokens in Views not Rendering Inside an HTML Element

I'm using views to create a custom block of shortcut icons and need the images to link to the corresponding content. Using Rewrite Results I can overwrite the output of the view and have an anchor tag ...
0
votes
1answer
438 views

“Add an item to a list” using rule just works for plain text

I created a rule with an action which "Add an item to a list". The value of the item to add is this (also see my picture bellow) Voucher: [node:title]. The code for this voucher is [codigo-otorgado:...
0
votes
1answer
45 views

Webform token formatting

I'm trying to get the answers from one form, pre-filled in another form by adding tokens in the confirmation URL. This works for most answers while using the token: [webform_submission:values:?] ...
0
votes
0answers
20 views

Token support on the menu link field

Is there is any alternative way to make token to work in the Drupal 8 menu link field other than Menu Token module. I want to use token to set as a default value when I am creating new menu, but if I ...
1
vote
1answer
526 views

Alter label with token

I am trying to build a questionnaire that simply replaces (alters) the label of a list-field. I´m doing so by replacing a token from views (embed) and using a hook_alter_form function in an separate ...
0
votes
1answer
559 views

Replacement pattern for one value of a multivalue field in views

Rewriting the results of a views field, I wonder if there is a way to use a replacement pattern for the first, second and third value of a multivalue field. In my case, as example: I have tried to ...
0
votes
0answers
52 views

How to get URL on Computed Twig field (with tokens)

I have a Computed Twig field created on my webform. (Using webform module). In the "Computed value/markup" I have entered the value "{{ uri }}" token, and the url is correctly ...
0
votes
1answer
33 views

Tokens missing in Webform Emails after upgrading

Currently running Drupal 7.69 / PHP 7.3 (+ CiviCRM) I have recently updated some Modules : Webform, Views Bulk Operations, i18n, and Content Access. Since then, my Webform Emails do not show the ...
0
votes
1answer
1k views

How to Logout user with Basic auth?

I can log in, perfectly fine, but can't get logout to give me a JSON response. Currently, I can only do POST to d8.com/user/logout?csrf_token=123&?_format=json and that would log out, even ...
1
vote
1answer
607 views

How do I filter the current year?

Initially, I have installed the Token module and created a Views block containing years. I want to filter out the current year from the block (it should not show the current year). In filter ...
0
votes
1answer
489 views

Views Custom Field Handlers tokens

I am using simple views custom field handler. And I would like to make list of custom tokens for this $data array I have. How could I do that? class custom_views_handler_field_hostname extends ...
0
votes
0answers
19 views

Menu token not working sometimes

I am using /user/[current-user:uid]/edit to generate the user profile setting page where user can edit there profile. Sometimes it works and sometimes it displays the wrong user id and sometimes I get ...
0
votes
0answers
15 views

Formatting labels of Webform2PDF for submissions

How would I go about changing style for all the labels for pdf generated from submissions to a webform. I could explicitly state each [submission:values:email:label] and then provide values with ...
1
vote
1answer
22 views

Tokens in field widget don't work

I am using drupal 8. I want to add tokens to the paragraph image field widget as data-attribute, but it doesn't work. What can be caused by this problem? Is it need some modules? Here screenshot: ...
1
vote
0answers
56 views

Is there any workaround for the “Global Text” area in “No results behavior” that doesn't process chained tokens?

I have a view with a contextual filter for the node ID. If the view returns no result, I would like to display a fixed picture (no problem) linking to a path containing the node ID from the filter in ...
1
vote
1answer
631 views

Use Exposed Filter value in no result Global text

I'd like to use the value of the chosen Exposed Filter (=dropdownlist) in the Global text block when there is no result. In detail: Exposed filter (which is a taxonomy list) has 3 values of provinces:...
0
votes
1answer
24 views

How to get taxonomy tree with path auto token?

I'm using Path auto module to automatically set url of articles. Last part of url is node title and [node:title] works just fine. But url part before node title should follow taxonomy structure (tree) ...
0
votes
2answers
55 views

Can't get token replacement to work

I have nearly this exact case but as it applies to Drupal 8: Store token replacement values in the database rather than tokens themselves). I have a content type 'article' with a 'body' field ...
0
votes
2answers
49 views

Custom tokens breaking on node save with “node entity cannot have a URI” error

I'm getting a crash on node save when my node contains a custom token. I'm using the Token Filter module to display tokens in node content. To make the tokens I followed this tutorial, which is ...
1
vote
0answers
20 views

File (Field) Path settings to rename multiple images with their alt or title

The module File (Field) Path allows me quite nice to rename a single image file with its "alt" or "title". But if allow the image field to accept multiple downloads, I cannot get the individual alt/...
0
votes
1answer
35 views

CKEditor strips all inline CSS and some tokens

I'm trying to add a color and font size to some text using the CKEditor. As soon as I save it these are stripped out. I've also noticed some tokens are stripped down when certain settings are enabled. ...

1
2 3 4 5
14