3

Do Config entities have views support? What I have:

  1. ConfigEntity which have fields: id, admin_label, display_label, config_options.
  2. ContentEntity with fields: id, entity_config_id, author.
  3. entity_config_id is an entity_reference to ConfigEntity entity.
  4. I use views to show all ContentEntity entities and I outputted fields: entity_config_id, author.

What I need:

I want to output in views with ContentEntity some additional fields from ConfigEntity(e.g. display_label). But I can't do it, because I don't see any way how to integrate ConfigEntity with views.

  • EntityConfig - api.drupal.org/api/drupal/8/search/EntityConfig? Migrate process? Or entityKeys from Node object? – Vagner Mar 3 '16 at 12:38
  • see drupal.org - what entity configuration is. It doesn't related nor to Migrate process neither to Node. – Maria Kvitova Mar 3 '16 at 13:14
  • So, you need use entity configuration of views? As you can see your question don't provide enough info to make a right answer. Maybe you want to load config of an entity, which next page of your link explain how to do. But it depends of your context if its a good idea, because these values already in Entity object, but sometimes with different key. – Vagner Mar 3 '16 at 13:44
  • I think my question provide enough information for the answer. It's not a problem if you don't understand what I need. – Maria Kvitova Mar 3 '16 at 14:17
  • Ok, sorry, but is exactly this, I don't understand what you need, maybe if you can be more clear, more users will be able to help, as I pretend to do, if don't want my help just say. – Vagner Mar 3 '16 at 14:27
4

No, there is no views integration for config entities (that's the term you mean, not entity configuration).

The easiest way to achieve what you want is to write custom custom views field plugins and define it in a EntityViewsData class for your entity and then just access the config entity and render what you want.

  • Tnx a lot for your answer! I fix wrong term usage in my question. – Maria Kvitova Mar 3 '16 at 20:13
3

I have created a module to expose Config Entities to the views. I just pushed the first, initial, commit to my sandbox.

  • Install as usual: Config View
  • Configure which Config Entities you are going to expose to the view: /admin/config/config_view
  • Create a view: /admin/structure/views/add config entity will show up in the View Settings

Hope it will help.

Config View

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.