Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

-1
votes
0answers
24 views

Use Token in twig template

I would like to use the token [paragraph.field_zwischenseite_link] in my twig template to link my parent div. Unfortunately I get the error Message "The website encountered an unexpected error. ...
0
votes
1answer
15 views

How to get Webform Radio Option Value as a token value for email template?

I am trying to use my webform's radio field to choose between two departments, let's call them ABCDE and XYZ. On the webform display that the user sees, I want them to show up as ABCDE and XYZ. When ...
2
votes
1answer
62 views

How to dynamically redirect user from /foo/X to /bar/X?

So far I did the following: I've installed Redirect and Token modules. I've applied the patch for Redirect module to support wildcards. I've applied the patch for Redirect module to implement ...
1
vote
1answer
31 views

How to find where are defined tokens for Redirect?

After enabling Token and Redirect modules, I've found at /admin/help/token that I can use Redirect tokens. For example: However, I've got the problem finding the place where and how these tokens are ...
-2
votes
0answers
15 views

Custom module tokens are not available in message templates created via message module

We have a custom module that adds some tokens which are available site wide, however these tokens are not available in message templates that are created via the message module. Is there a way to ...
3
votes
1answer
94 views

How can I link to a specific comment on drupal.org?

I'm aware that you can use [#1234] syntax in posts on drupal.org issue pages. However, is there any syntax to point to the specific comment, like: [#1234:12]? I was using it before, but I forgot the ...
0
votes
0answers
13 views

Webform submission tokens in emails

I am trying to print the webform submission label and value from tokens in confirmation email. The problem is that the label of the form element is not appearing, only the value. Tried with: [...
0
votes
0answers
6 views

Search result from tokens

I need to customize my search result page. Now I don't have cpanel access so what modules can be used to do that? Another thing is that the search result page is generating and displaying result using ...
1
vote
1answer
23 views

Customize the appearance of sharing articles to social media

I am new to Drupal and I just added a few buttons for sharing articles to social media (Facebook, Twitter etc.) I want to customize the appearance of sharing posts. After a few "research" I found out ...
0
votes
0answers
42 views

WebForm Select Element using Entity Reference View cannot use token in arguments

I'm trying to create a D8 webform that will take a date entered on Page 1 of the multipage form, and utilize that date as the contextual argument for an Entity Reference View. My date field is named ...
0
votes
1answer
31 views

Show the ID of referenced entities using tokens, instead of the label with link

I have a content type, Company, which is referenced to a User with an entity reference. The token for that entity reference for the current user is [current-user:field_user_company]. No matter ...
0
votes
1answer
36 views

How to display custom token in custom block

In a Drupal 8 website I created a custom token that is working in basic page. Then I created a custom block with a WYSIWYG field : class Myblock extends BlockBase { public function __construct(...
0
votes
0answers
32 views

How to display a token in plain text?

I want to display the type of product in a Message. If I put the token below it works, but there is a link to the type of product. [message:field_product_reference:entity:type:name] I want to ...
0
votes
0answers
16 views

How to embed a login or register form inside a page content body

First of all I am new to drupal. I am looking for a solution where I can include a login or register form in the body of a page with admin-editable page content/markup flowing before and after it. ...
0
votes
0answers
26 views

handle URL alias with URL query Parameter

Im using the newest Drupal 8 Version, which is hosted by Bitnami on an ec2. Basicly im trying to transform an URL which contains URL querys to an user friendly URL. So: www.xxx.com/article?shop=A&...
0
votes
0answers
17 views

Setting the default value of the country field in an address with tokens and hooks

I would like to set the default value of the country in the Drupal address field (address module) with a country that I have collected in another process on my site. It would be great if I could "...
0
votes
0answers
22 views

Error on URL aliases unable to find the reason

I am using path and pathauto module on my project. It was a old project recently I updated the core and all contributed modules. After that the pattern of path for URL aliases was working fine. But ...
-2
votes
1answer
69 views

How to display a token in plain text (without link)?

I created a form with the module "Webform" on "Drupal 8". In the form submission email, there is a token: [webform_submission:values:profil:entity:field_personnel_sexe] In the inbox, the term ...
0
votes
1answer
18 views

Possible to have conditional Tokens?

In using URL aliases, is there a way to have conditional token usage? An example of what I'm looking for is: I have programs on my page, each having their own unique program code. By default, say my ...
0
votes
1answer
100 views

How to show different delta of a multi-value token?

I have a multi-value field for user statistics (around 18 INT values): the field field_nurse_patients contains 18 integers 0,5,3,3... Is there a way to get a format like below with tokens? Maybe ...
0
votes
0answers
47 views

Use contextual filter as a token in a view

I have a Drupal 8 site with a view that uses a taxonomy term as a contextual filter. In a block display for this view, we have a custom button, defined in the footer, that links to a page showing the ...
0
votes
1answer
54 views

Metatag images don't work anymore after updating [closed]

I was on Drupal 8.5.x and Twitter cards and Open Graph on Facebook were displaying correctly. After updating to Drupal 8.6.1, the images don't display anymore. The others data (title, description, ...
0
votes
0answers
48 views

How to display the title of the parent node of the comment in the Message?

I installed the "Message" module. I want to display the tokens with the reference field of the node. Currently : [message:node-title] is replaced from the title of the parent node, but [message:...
0
votes
1answer
94 views

Why doesn't the token for the node title work?

In Drupal 8, I activated the Message module and the Message Example sub-module. These are the fields I added to the template to create a message when a new comment is created. This is the ...
1
vote
0answers
159 views

Get token of image field in paragraph field

We're implementing the Open Graph metatags so that social media shares can know which image to use as the "share" image on our pages. I'm having a problem figuring out the token for a image field URL ...
0
votes
1answer
64 views

How to create a message when a new store is created?

I installed the Message module on my site : https://www.drupal.org/project/message And I created a custom module from the Message Example sub-module. Here is the content of the ...
1
vote
0answers
68 views

Is there a means of setting an alternative or a default for an undefined token?

I am using the nid in combination with other fields to set the title of a node, but as the nid is only defined after the node creation, the initial title has a blank in the nid's place. I have to ...
0
votes
1answer
36 views

How to display the user's image in a Message Template?

I activated the sub-module "Message Example" of the module "Message". I added the token in the "Example - User register" message template : [message:author:user_picture:thumbnail] When a message is ...
1
vote
2answers
36 views

What's the workflow behind [user:display-name] token?

I have seen in an email template, a token named [user:display-name]. Further noted that this token is not global, its value will only get rendered in email templates (correct me if I'm wrong). How ...
0
votes
1answer
35 views

form submitted value as token

I have created a form by extending FormBase class. In form, I'm having a field called "name" where user can input his name. While submitting form, I want that submitted name convert into token so that ...
2
votes
1answer
108 views

Where is the the full tokens list for a site?

In the Metatag module UI it uses tokens but only shows a small list of tokens that are relative to the site information rather than the full content tokens which it can use, in D7 there was an admin ...
0
votes
1answer
59 views

Token for Total Flag Count

I have created a flag for my comments named HELPFUL. If users find a comment helpful they vote it as such. The challenge that I have is how do I show the total votes for the flag next to the button? ...
0
votes
1answer
47 views

How to get the value of a taxonomy term from entity reference using a token?

We have an Entity reference field on Basic Page content type that is set to Articles. The Articles content type has a field, field_category that is a taxonomy term. What is the correct token to get ...
0
votes
1answer
19 views

Can tokens be used to set values of other fields and in modules which use tokens?

I am finding the Metatag module rather unwieldy, and I want to create fields in the content type from which Metatag values will be set. Are there tokens available for the fields of any arbitrary ...
0
votes
1answer
13 views

webform 5 access other webform tokens

Is there a way to access tokens of another webform ? I have users of one role who need to evaluate in a webform files uploaded by users with another webform
0
votes
2answers
23 views

Rewrite results for user picture to except tokens

I have a user role called "Residents" in D7, and created a view the show profile information. I want to add colorbox to the User Picture, but there is only one token available [picture]. How do I add ...
2
votes
0answers
35 views

Simple OAuth Role assignment within a Scope

I have a web app that has multiple scopes under a single OAuth consumer. I want the user's Drupal role to be used when logging in. In simple OAuth, I have created 1 consumer that has 2 scopes: ...
0
votes
1answer
113 views

can you put views field values into a global token?

Suppose I want to use a paragraph field value of an entity for metatag title (by using metatag views module) I can successfully get the value of the paragraph entity and display it on the view Now, ...
0
votes
0answers
15 views

Modal Webform How To Get Page Title Value

I am using modal forms to display a web form <a class="ctools-use-modal ctools-modal-modal-popup-small callback ctools-use-modal-processed" href="/modal_forms/nojs/webform/122">Get a Call Back&...
0
votes
0answers
34 views

Two different content paths for the same content type with different taxonomy terms

Sorry for the inaccurate title. I have a content type called product display. In product display I use taxonomy terms, 8 different term names, to categorize the different products. However, I have ...
0
votes
0answers
14 views

Custom created tokens are not replacing values when used in Rules->Action as email receiver

I'm trying to assign values from my custom created token called [custom:email] as the email receiver in Rules under Actions->Elements->Send Mail Following is described how I'm trying to achieve ...
0
votes
0answers
13 views

How to reuse a field value via token in another field within a form

In the form at node/add/article I want to use the current value that the user enters in Field A and Field B and use it in the core Title Field. Of course, there are handy modules like Automatic ...
1
vote
0answers
37 views

Paragraph fields as node tokens in Drupal 7

Is there a Drupal 7 equivalent to [node:field_paragraph:0:entity:field_hero_image]? I'm trying to use an image field in a paragraph as the og:image using the Metatag module, but the only token I can ...
0
votes
2answers
67 views

Drupal 8 Page Cache

I am using dynamic tokens in page title, which is always being cached. I want to stop that. I have try by disabling page cache using function hook_preprocess_page(&$vars) { $vars['#cache']['...
0
votes
1answer
306 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 ...
0
votes
0answers
81 views

change output of [webform_submission:values] token

By the default, the [webform_submission:values] token is replaced by the following HTML code in HTML emails: <b>Field title:</b><br /> field value<br /> <br /> <b>...
0
votes
0answers
43 views

How to reference field in custom token

I'm struggling to understand how to reference a field value in a custom token for Drupal 8. I want the token to use in the Automatic Entity Labels plugin. Basically, I just want the token to wrap a ...
0
votes
0answers
42 views

Load field from node id into webform hidden field in drupal 8

I have a staff directory view that passes the node id to the contact form in the url when you click a button, but I am having a problem with loading the associated email field into the email_to hidden ...
0
votes
1answer
42 views

How to add global variable/token to use site wide

My phone number exists many places like block, node body, view, etc. Currently, I enter my phone number all the places. If I migrate it to another site and phone number changes, I manually have to ...
0
votes
1answer
39 views

How to set alias pattern of node's source alias?

When I translate a node I want that node's path alias to be like it's source node's path alias. So in the url pattern for the translation nodes I use the token: [node:source:url:path] which ...