The documentation for adding custom fields to an entity display is only for 7.x, and this documentation doesn't match the 8.x functionality, as far as I can tell.

Comments

thomasmurphy created an issue. See original summary.

danny englander’s picture

In Drupal 8 for DS, you can go to /admin/structure/ds/fields and add two types. A "block field" or a "Token field." For example, I created a custom "byline" field like this as a token field.

By <a href="[node:author:url]">[node:author:display-name]</a> | [date:blog_date]

Once I saved that, the new field showed up at /admin/structure/types/manage/[content-type]/display and I was able to use that. In addition, I wanted to add some views to my DS displays so I also installed https://www.drupal.org/project/token_embed_views. So for example, I added a "Latest posts" view as:

[views:embed:latest_posts:block_1]

...using the tokens provided by token_embed_views.

phily’s picture

Then, how would you make the token field translatable (the "By" string in your code example)?

aspilicious’s picture

Status: Active » Fixed

See this blog post.
We deprecated some functionality to write code in the UI. (mainly for security reasons)
You should write a small module to achieve your goals.

https://www.sitepoint.com/custom-display-suite-fields-in-drupal-8/

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.