1

I have a content type with a field type Link. I would like to set default text and url for the field. Under:

Structure » Content types » MY CONTENT TYPE » Manage fields

I tried entering # and [current-page:url:absolute]. Both of them were not accepted and the below are the respective error messages:

  • The value [current-page:url:absolute] provided for MY FIELD NAME is not a valid URL.
  • The value # provided for MY FIELD NAME is not a valid URL.

What is the right way to enter the current node URL as a default value into a Link type field?

9
  • you can do by using rules module Commented Oct 5, 2015 at 10:57
  • 1
    Are you doing it in code, or on settings form? If in code, please post your code. If in settings form, please post a screenshot.
    – Mołot
    Commented Oct 5, 2015 at 11:08
  • @Mołot added additional info to the question. Commented Oct 5, 2015 at 11:27
  • What Drupal version? If 8, this is not yet possible.
    – Mołot
    Commented Oct 5, 2015 at 11:31
  • 1
    you need to use module field default token to work global as well local token.
    – vgoradiya
    Commented Oct 5, 2015 at 11:59

1 Answer 1

2

You need to use module field default token to work global as well local token in field value. You can use your previous token i.e. [current-page:url:absolute].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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