0

I've created a module that's add a content type to my site and I now want to understand how can I Link a Plain text fields to the Content in Teaser view mode programmatically in my module?
I currently can Link to the Content any Plain text field in:

Home>Administration>Structure>Content types>Content types name>Manage display

Teaser Manage display page, see below image: enter image description here and I want to understand how can I get access or implement this property (feature) in my module, I try to achieve this by adding below code to my module:

#core.entity_view_display.node.teaser
field_version:
  type: string
  weight: 2
  label: inline
  settings:
  third_party_settings: {  }

To no avail.

Thank you for any help.

2
  • I can't understand the difference between what you say you can do and what you want to do.
    – Jonathan
    Commented Sep 20, 2016 at 10:48
  • @Jonathan: Thanks for your reply, I want to implement this property in my module. Commented Sep 20, 2016 at 13:34

1 Answer 1

1

This is the setting link_to_entity: true:

field_version:
  type: string
  weight: 2
  label: inline
  settings:
    link_to_entity: true
  third_party_settings: {  }
2
  • Thank you so much, Is it possible to edit Title of content type and add this property to it, (Link Title of node Teaser to content). Commented Sep 20, 2016 at 18:59
  • The title field is not configurable. The linked title for teasers is hard coded in the node twig. It is in the variable {{ label }}.
    – 4uk4
    Commented Sep 20, 2016 at 19:23

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.