Questions related to the Token module, or a form of token replacement system.

learn more… | top users | synonyms (1)

1
vote
1answer
43 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
2answers
22 views

How to get delta of a file from within hook_tokens

I am trying to create a delta token in my module. In hook_tokens, I manage to get the file object, but I have no clue on how to get the delta of my file... Here is my implementation of ...
1
vote
1answer
48 views

Catch the English name of a translated taxonomy term (token)

I'm building up a multilingual website (Drupal 7) with Locale and Content translation modules enabled for nodes. The node category is managed thru a content_area field (taxonomy term thru Entity ...
4
votes
3answers
126 views

Is there a list of file/image field subtokens?

Token browser does not show the options for file properties. [node:file-field:0:file:url] gets the url, but is there a list of all file options? Or is there a way to check it from sourcecode somehow? ...
0
votes
0answers
7 views

Getting a Book ID Token for Use in Menu

Using the books module I was hoping to have another menu to add a child page to a book, other than the immovable one that comes as default. My plan was to use the Menu Tokens to achieve this. ...
2
votes
1answer
31 views

Custom formatting of tokens for date fields

In D8.1, I have created a field called field_date and added it to a content type. I try to use pathauto to try to configure a URL pattern for the content type like type/year/title. But the token ...
0
votes
0answers
22 views

How do I get an entity reference parent using tokens?

Setup I have an entity reference chain that is kind of complicated. It's basically using Drupal to build a dynamic database with nodes being the tables and entity reference acting to store external ...
1
vote
0answers
10 views

Output empty text instead of unevaluated token (in JS Block)

I'm trying to output data through a block using JavaScript for Intercom. Most tokens work fine, but if the source field for the token is blank, the token itself is returned instead of any value. Of ...
1
vote
0answers
22 views

Node needs save -> edit -> save to fill all fields

I have a Drupal node form with fields that depend on each other. 1 - first field (text) takes data (using default value and tokens) from other fields 2 - second field takes data from the first field ...
0
votes
1answer
32 views

how to use token in “Execute custom PHP code” in a rule

I used "Execute custom PHP code" in my pricing rule. However I got Notice when I checkout: Notice: Use of undefined constant testsku - assumed 'testsku' in eval() (line 7 of /var/www/jmu/sites/...
1
vote
0answers
19 views

verification mail link not working

I have the following issue: When a user register to the site he receives a message with a unique url in order to activate his account. so far so good. However when the user clicks the link provided ...
3
votes
1answer
18 views

Making File Size visible to anonymous users

I have media installed for file handling, and am displaying download links for my files using display suite. I have the file size being loaded in as a dynamic field loading token [file:size]. ...
0
votes
1answer
33 views

Use Token in contact form as default value

I have a contact form build from the drupal core contact forms. I am trying to prefill some fields from URL GET parameters like this. /?foo=bar But it seems that "default value" doesnt support tokens....
0
votes
0answers
12 views

Is there a way to render a node with view mode via token?

Is there a way to render a node with view mode via token? Like: [node:5:teaser]
0
votes
0answers
6 views

Migrate D6 ImageField Extended captions to D7 File Entity Inline captions

First of all, I am completely new to the Drupal world and my apologies if I fail at clearly explaining my issue, or if I am missing something that should be obvious. I "inherited" a D6 website just ...
0
votes
2answers
25 views

Render a referenced node via token in field

This feels like it should be something people have tried, but I can't find anything after some googling. My use case is simple, I have a node type that only has 2 fields, body and media. The media ...
0
votes
1answer
32 views

Pass contrib module tokens to custom event in rules

I am creating a custom rules event using hook_rules_event_info. This custom event is extending the features of the Stripe Subscription contrib module. The custom rules event is working fine so far. ...
1
vote
0answers
33 views

How can I pass values to Rules?

I would like to pass values to Rules (eg an array of words) and then do some Rules magic with them (eg create new nodes if they dont exist already). I found one solution here How to reference ...
0
votes
0answers
9 views

Display text in dropdown

My user needs to be able to create a dropdown/select list when creating a new node. So what I did was create a text field with the ability to add unlimited fields. I looked at the text formatter ...
2
votes
1answer
24 views

How do I get the fields of form attached with a content type as token?

I do not know is it possible or not. I have a content type for creating tickets. I have a form attached to content type which contains ticket state and ticket assignee fields as drop down. Now I want ...
1
vote
2answers
27 views

Can I use AddressBook values to populate a webform field?

I am currently trying to make lots of things work together. I'll try to put it simple without annoying details. I work on a lawyer's site with drupal commerce installed, as well as AddressBook, ...
1
vote
0answers
30 views

Displaying Token Field Labels From Fetched Entity In Rules HTML Email

I am sending a MIME HTML email using rules. Much of the information contained in the email comes from a fetched custom entity (custom ECK entity). Using the available replacement patterns, I can get ...
0
votes
1answer
95 views

How do I make parent taxonomy paths?

I installed Pathauto, Tokens and Entity API module in Drupal 8 and I have been unable to create a pattern that would allow parent taxonomies and then the final node for content type pages. In Drupal 7 ...
0
votes
1answer
19 views

File directory token - image field - node author

How to setup file directory where the images are saved to use tokens based on node author ? I have all setup with current user, but this is not good if moderator or admin needs to make a change with ...
0
votes
1answer
12 views

Multiple dates token for auto node title

I am using this token to create node title [node:field-date-concert:custom:j-m-Y] and it works fine if there is one value for date in node. Problem is that if there are 2 or more values i only get ...
1
vote
1answer
39 views

Is there a token for the key of a text list?

I need to get the key of the key|value pair from a text list field in a token. Say the field configuration shows the following options: no|No Way Jose! yes|Why yes, that'd do nicely! and the field ...
0
votes
1answer
11 views

What are efficient solutions to prevent a huge amount of panes in a Panel?

Using Panels for some years I still have one question that I struggle with. I have set up a Panel with a special layout, with a filter on a specific bundle type. I have more than 10 views content ...
1
vote
2answers
37 views

Views: add (link to file field) to image field

In D7, I have an event content type containing an image field ("Featured image") and a file field ("Document"). I have a view of events containing documents, and would like to wrap a link around the ...
0
votes
0answers
21 views

Metatag OpenGraph for youtube video using Embbed Video field module

I cannot find a way to make Metatag Opengraph use the correct tokens for sharing video content type on Facebook. My field is field_video and I am using it in video in opengraph. Since this is not ...
3
votes
1answer
55 views

Can I store a computed field as a field of a Content Type?

In content type = Person, I have these fields: - First Name [node:field_person_first_name] - Middle Name [node:field_person_middle_name] - Last Name [node:field_person_last_name] - Suffix [node:...
0
votes
0answers
13 views

Taxonomy tokens are not available in views bulk operations

I am trying to rewrite taxonomy term names and I'm using views bulk operations. I need the term name token to be available, but all I'm getting is site info tokens. I know that the order of the ...
0
votes
0answers
57 views

Webform submission tokens empty

when a form is submitted, then drupal sends a email with submission values empty. Default email template is: Submitted on [submission:date:long] Submitted by user: [submission:user] Submitted values ...
0
votes
2answers
35 views

Global view footer not replacing tokens

I am having a problem with token replacement in a views footer. I added a "Global: Unfiltered text" footer, and checked "Use replacement patterns", and added [title]. However, it shows up as the ...
0
votes
2answers
39 views

clearing cache to call hooks in .module file

I have created a token in .module file. that gives current node title. But every-time I change the title of node, I have to rebuilt cache so that updated title get reflected in my token. Of-course ...
1
vote
2answers
44 views

modify date token in View to extract only year?

We have a content type using a date field, in which the date is entered in the format mm/yyyy. An example entry might be 04/2016. In one particular View, we want to use only the Year value. It appears ...
0
votes
0answers
13 views

Social Cards for Video content type

I'm using a content type called Video with a field from Video embed field module . I'm generating an automatic thumbnail for the video using thoses modules: Imagecache Actions Imagecache Canvas ...
-1
votes
1answer
31 views

Using a rest plugin or a service how can one tell the token module the response is not cachable

I have a rest plugin which returns an array and sends a mail. When commenting the Token::replace all works fine, the token replace function creates a BubbleableMetadata object (from what I understand ...
0
votes
1answer
23 views

I need to format text with a token

I am using tokens to display a field and want it formatted with plain text: [node:body:format-plain_text] I have a feeling my syntax is wrong, how do I make it right?
0
votes
0answers
17 views

How to create default values with token for form fields

I am creating a module with a submit form, and I am looking for a way to set the default value of a form field using tokens. (The default text should be editable as well.) What is a good way of doing ...
1
vote
2answers
85 views

In views, how to create link to field visible through relationship connection?

I don’t want to link to the original piece of content (which is a join table) but to the content type which is referenced in the join table. Using: Views, Entity Reference, Entity Tokens, Token. I ...
1
vote
1answer
46 views

Date token to use user timezone instead of site timezone

Our site is having users from different timezones and we are sending event notification emails using rules. We need to specify the event date-time in addressee's timezone. So, is there any way to ...
0
votes
0answers
15 views

D7 getting another module token value in module

Please advise the best way (or at least one) to get custom tokens (actually Simplenews') value in my module token? The case is: I made an addon to SN module, which extends it by adding a new set of ...
1
vote
0answers
31 views

Metatags module not rendering tokens in content

We created custom tokens for a site and they are included in things like titles and summaries, so are picked up by the metatag module. However, when I look at search results in Google, I see the ...
1
vote
1answer
17 views

Using webform 4.x values in other fields/descriptions on multi-page webforms

Is there a way to output values of other field values in a multi-page webform? Say I have a 3 page webform. First page is name, email, then address. How can I reference the name value in the last page ...
0
votes
0answers
20 views

Drupal webform using ubercart address token as default value

I am trying to pre-populate a webform field with a registered user's Firstname, which is stored as an Ubercart address value. The available tokens are listed as: [current-user:default-billing-address:...
0
votes
0answers
15 views

node:menu-link:parent:url:path out putting node parent ID instead

Not sure what's changed recently but [node:menu-link:parent:url:path] was working up to a few weeks ago now when I save a node I get the parent node ID in the url instead of the actual path so it ...
1
vote
1answer
41 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
91 views

Need to save node twice to get wanted result

I have made 2 custom tokens that I use to determine the URL alias in the Pathauto pattern. They work fine too, but since my custom tokens rely on certain (taxonomy) fields in the node, they always get ...
0
votes
1answer
50 views

Second Product variant image in fb share is not coming

I am using [node:field-product:0:field_images] metatag image. With which I am getting top level variant image always. How can I get my second product variant image in facebook share, when I select ...
1
vote
1answer
46 views

Services Module Authentication with Username and Password in URL

I have to match the following format when implementing Services to maintain some legacy APIs that were poorly written. I understand this is horrible practice and we're going to provide a new better ...