-1

I've created a custom content type and I have a field which referencing a views (Using Viewfield Module). Now I want to alter the field label using [current-page:title] token, But Token isn't working on field label.

I've tried [current-page:title] on field label, But the token is just print out not value.

How can I Use token on Field label?

2

These two articles might help you out:

https://www.drupal.org/node/1299662

(From this article)

The Token module for Drupal 7 currently provides support for basic-level field tokens like [node:field_my_image_field] and [node:field_node_reference_field].

Customizing field token output

Sometimes the field tokens may not output as desired. To change how they are output, you must perform the following steps:

Enable the 'Token' custom display setting. Go to the "Manage display" of the entity type and bundle for which token you are trying to change. For example, to change how fields on Article nodes are displayed in tokens, go to admin/structure/types/manage/article/display. Expand the Custom display settings fieldset at the bottom of the page, click the "Tokens" checkbox, and then click the Save button.

https://www.drupal.org/node/2261729

(From this article)

The labels are not part of the field and are not intended to be. The style renders the field and label separately. In the vast majority of use cases, you do not want the label. If you do, you can rewrite the original field to include the label, or include the label as you like.

  • Though these might answer the question, please include the relevant parts from these resources in your answer in case the links go down. Thanks. – Neograph734 Mar 22 '17 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.