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?

  • you can do by using rules module – Adeel Nawaz Oct 5 '15 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 Oct 5 '15 at 11:08
  • @Mołot added additional info to the question. – Kannan Ramamoorthy Oct 5 '15 at 11:27
  • What Drupal version? If 8, this is not yet possible. – Mołot Oct 5 '15 at 11:31
  • 1
    you need to use module field default token to work global as well local token. – vgoradiya Oct 5 '15 at 11:59
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, privacy policy and cookie policy

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