What is the name of the table where view modes are stored?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite












We have 10 view modes that we created. When we run drush @env cex sync in our local we are able to export the config files related to these view modes such as core.entity_view_mode.node.related.yml (where related is the view mode).



Is there a database table where these View modes are stored? If so, what is the name of it?



We are not using Display Suite or Panels, just the out of the box View Modes from Core. We do not plan to add those modules.



Goal:



  1. Find out what view modes are being used programmatically.

  2. Delete all view modes that are not being used.

Definition of not being used:




  1. Article content type has 3 custom view modes: listing, minimum, related


  2. Basic Page content type has an Entity reference to Article pages where the Article view mode = listing under Basic Page Default View Mode.

  3. Custom view modes listing and minimum are not being used. However, if we consider all content types (e.g. 10 more content types) then it will be a pain to have to go through one by one.






share|improve this question






















  • you say in definition - #2 "Article view mode = listing", then on #3 "listing and minimum are not being used.", can you review this please?
    – Cesar Moore
    Sep 6 at 20:45










  • it seems like you know which view modes are not in use, so why don't you just delete them in the admin interface (/admin/structure/display-modes/view)?
    – Cesar Moore
    Sep 6 at 20:48










  • @CesarMoore I have updated the questions goal and definition. We are looking for a programmatic way to figure out what is being used and what is not. Hopefully it is clear now.
    – usernameabc
    Sep 6 at 22:53
















up vote
1
down vote

favorite












We have 10 view modes that we created. When we run drush @env cex sync in our local we are able to export the config files related to these view modes such as core.entity_view_mode.node.related.yml (where related is the view mode).



Is there a database table where these View modes are stored? If so, what is the name of it?



We are not using Display Suite or Panels, just the out of the box View Modes from Core. We do not plan to add those modules.



Goal:



  1. Find out what view modes are being used programmatically.

  2. Delete all view modes that are not being used.

Definition of not being used:




  1. Article content type has 3 custom view modes: listing, minimum, related


  2. Basic Page content type has an Entity reference to Article pages where the Article view mode = listing under Basic Page Default View Mode.

  3. Custom view modes listing and minimum are not being used. However, if we consider all content types (e.g. 10 more content types) then it will be a pain to have to go through one by one.






share|improve this question






















  • you say in definition - #2 "Article view mode = listing", then on #3 "listing and minimum are not being used.", can you review this please?
    – Cesar Moore
    Sep 6 at 20:45










  • it seems like you know which view modes are not in use, so why don't you just delete them in the admin interface (/admin/structure/display-modes/view)?
    – Cesar Moore
    Sep 6 at 20:48










  • @CesarMoore I have updated the questions goal and definition. We are looking for a programmatic way to figure out what is being used and what is not. Hopefully it is clear now.
    – usernameabc
    Sep 6 at 22:53












up vote
1
down vote

favorite









up vote
1
down vote

favorite











We have 10 view modes that we created. When we run drush @env cex sync in our local we are able to export the config files related to these view modes such as core.entity_view_mode.node.related.yml (where related is the view mode).



Is there a database table where these View modes are stored? If so, what is the name of it?



We are not using Display Suite or Panels, just the out of the box View Modes from Core. We do not plan to add those modules.



Goal:



  1. Find out what view modes are being used programmatically.

  2. Delete all view modes that are not being used.

Definition of not being used:




  1. Article content type has 3 custom view modes: listing, minimum, related


  2. Basic Page content type has an Entity reference to Article pages where the Article view mode = listing under Basic Page Default View Mode.

  3. Custom view modes listing and minimum are not being used. However, if we consider all content types (e.g. 10 more content types) then it will be a pain to have to go through one by one.






share|improve this question














We have 10 view modes that we created. When we run drush @env cex sync in our local we are able to export the config files related to these view modes such as core.entity_view_mode.node.related.yml (where related is the view mode).



Is there a database table where these View modes are stored? If so, what is the name of it?



We are not using Display Suite or Panels, just the out of the box View Modes from Core. We do not plan to add those modules.



Goal:



  1. Find out what view modes are being used programmatically.

  2. Delete all view modes that are not being used.

Definition of not being used:




  1. Article content type has 3 custom view modes: listing, minimum, related


  2. Basic Page content type has an Entity reference to Article pages where the Article view mode = listing under Basic Page Default View Mode.

  3. Custom view modes listing and minimum are not being used. However, if we consider all content types (e.g. 10 more content types) then it will be a pain to have to go through one by one.








share|improve this question













share|improve this question




share|improve this question








edited Sep 6 at 22:50

























asked Sep 6 at 18:03









usernameabc

569317




569317











  • you say in definition - #2 "Article view mode = listing", then on #3 "listing and minimum are not being used.", can you review this please?
    – Cesar Moore
    Sep 6 at 20:45










  • it seems like you know which view modes are not in use, so why don't you just delete them in the admin interface (/admin/structure/display-modes/view)?
    – Cesar Moore
    Sep 6 at 20:48










  • @CesarMoore I have updated the questions goal and definition. We are looking for a programmatic way to figure out what is being used and what is not. Hopefully it is clear now.
    – usernameabc
    Sep 6 at 22:53
















  • you say in definition - #2 "Article view mode = listing", then on #3 "listing and minimum are not being used.", can you review this please?
    – Cesar Moore
    Sep 6 at 20:45










  • it seems like you know which view modes are not in use, so why don't you just delete them in the admin interface (/admin/structure/display-modes/view)?
    – Cesar Moore
    Sep 6 at 20:48










  • @CesarMoore I have updated the questions goal and definition. We are looking for a programmatic way to figure out what is being used and what is not. Hopefully it is clear now.
    – usernameabc
    Sep 6 at 22:53















you say in definition - #2 "Article view mode = listing", then on #3 "listing and minimum are not being used.", can you review this please?
– Cesar Moore
Sep 6 at 20:45




you say in definition - #2 "Article view mode = listing", then on #3 "listing and minimum are not being used.", can you review this please?
– Cesar Moore
Sep 6 at 20:45












it seems like you know which view modes are not in use, so why don't you just delete them in the admin interface (/admin/structure/display-modes/view)?
– Cesar Moore
Sep 6 at 20:48




it seems like you know which view modes are not in use, so why don't you just delete them in the admin interface (/admin/structure/display-modes/view)?
– Cesar Moore
Sep 6 at 20:48












@CesarMoore I have updated the questions goal and definition. We are looking for a programmatic way to figure out what is being used and what is not. Hopefully it is clear now.
– usernameabc
Sep 6 at 22:53




@CesarMoore I have updated the questions goal and definition. We are looking for a programmatic way to figure out what is being used and what is not. Hopefully it is clear now.
– usernameabc
Sep 6 at 22:53










2 Answers
2






active

oldest

votes

















up vote
2
down vote













View modes are stored in the configuration entity entity_view_mode which you can load like any other entity:



$view_mode = Drupal::entityTypeManager()
->getStorage('entity_view_mode')
->load('node.teaser');


To load all view modes for the entity type node:



$view_modes = Drupal::entityTypeManager()
->getStorage('entity_view_mode')
->loadByProperties(['targetEntityType' => 'node']);


View modes don't store much data other than a label for the view mode name.



How a view mode is displayed for a specific content type is stored in a different entity:



$display = Drupal::entityTypeManager()
->getStorage('entity_view_display')
->load('node.article.teaser');


The usage depends on how you define what being used means. If you mean with not used that it is not configured in a content type, which you can query in the config entities mentioned before, this doesn't mean necessarily, that the view mode is not used anywhere. If you configure an entity to be displayed in a view mode, for example in a View or a entity reference field, and this view mode is not configured in the content type, then it fallbacks to the default view mode.






share|improve this answer






















  • Just updated the question with definition of not being used
    – usernameabc
    Sep 6 at 20:33










  • If this is only for the usage between referenced content types you could load all displays like in the last code example and check the field formatter settings of all reference fields. But this would be only one of many places where view modes can be used.
    – 4k4
    Sep 6 at 21:18


















up vote
1
down vote













The configuration is stored in the config table



mysql> describe config;
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| collection | varchar(255) | NO | PRI | | |
| name | varchar(255) | NO | PRI | | |
| data | longblob | YES | | NULL | |
+------------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)


This is an example query from the umami demo profile:



 mysql> select name from config where name like 'core.entity_view_display.node.article.%';
+-------------------------------------------------------+
| name |
+-------------------------------------------------------+
| core.entity_view_display.node.article.card |
| core.entity_view_display.node.article.card_common |
| core.entity_view_display.node.article.card_common_alt |
| core.entity_view_display.node.article.default |
| core.entity_view_display.node.article.full |
| core.entity_view_display.node.article.rss |
| core.entity_view_display.node.article.teaser |
+-------------------------------------------------------+
7 rows in set (0.00 sec)





share|improve this answer






















  • This is an answer to the original question: "What is the name of the table where view modes are stored?" ... "Is there a database table where these View modes are stored? If so, what is the name of it?"
    – Cesar Moore
    Sep 6 at 20:58










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "220"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdrupal.stackexchange.com%2fquestions%2f268886%2fwhat-is-the-name-of-the-table-where-view-modes-are-stored%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote













View modes are stored in the configuration entity entity_view_mode which you can load like any other entity:



$view_mode = Drupal::entityTypeManager()
->getStorage('entity_view_mode')
->load('node.teaser');


To load all view modes for the entity type node:



$view_modes = Drupal::entityTypeManager()
->getStorage('entity_view_mode')
->loadByProperties(['targetEntityType' => 'node']);


View modes don't store much data other than a label for the view mode name.



How a view mode is displayed for a specific content type is stored in a different entity:



$display = Drupal::entityTypeManager()
->getStorage('entity_view_display')
->load('node.article.teaser');


The usage depends on how you define what being used means. If you mean with not used that it is not configured in a content type, which you can query in the config entities mentioned before, this doesn't mean necessarily, that the view mode is not used anywhere. If you configure an entity to be displayed in a view mode, for example in a View or a entity reference field, and this view mode is not configured in the content type, then it fallbacks to the default view mode.






share|improve this answer






















  • Just updated the question with definition of not being used
    – usernameabc
    Sep 6 at 20:33










  • If this is only for the usage between referenced content types you could load all displays like in the last code example and check the field formatter settings of all reference fields. But this would be only one of many places where view modes can be used.
    – 4k4
    Sep 6 at 21:18















up vote
2
down vote













View modes are stored in the configuration entity entity_view_mode which you can load like any other entity:



$view_mode = Drupal::entityTypeManager()
->getStorage('entity_view_mode')
->load('node.teaser');


To load all view modes for the entity type node:



$view_modes = Drupal::entityTypeManager()
->getStorage('entity_view_mode')
->loadByProperties(['targetEntityType' => 'node']);


View modes don't store much data other than a label for the view mode name.



How a view mode is displayed for a specific content type is stored in a different entity:



$display = Drupal::entityTypeManager()
->getStorage('entity_view_display')
->load('node.article.teaser');


The usage depends on how you define what being used means. If you mean with not used that it is not configured in a content type, which you can query in the config entities mentioned before, this doesn't mean necessarily, that the view mode is not used anywhere. If you configure an entity to be displayed in a view mode, for example in a View or a entity reference field, and this view mode is not configured in the content type, then it fallbacks to the default view mode.






share|improve this answer






















  • Just updated the question with definition of not being used
    – usernameabc
    Sep 6 at 20:33










  • If this is only for the usage between referenced content types you could load all displays like in the last code example and check the field formatter settings of all reference fields. But this would be only one of many places where view modes can be used.
    – 4k4
    Sep 6 at 21:18













up vote
2
down vote










up vote
2
down vote









View modes are stored in the configuration entity entity_view_mode which you can load like any other entity:



$view_mode = Drupal::entityTypeManager()
->getStorage('entity_view_mode')
->load('node.teaser');


To load all view modes for the entity type node:



$view_modes = Drupal::entityTypeManager()
->getStorage('entity_view_mode')
->loadByProperties(['targetEntityType' => 'node']);


View modes don't store much data other than a label for the view mode name.



How a view mode is displayed for a specific content type is stored in a different entity:



$display = Drupal::entityTypeManager()
->getStorage('entity_view_display')
->load('node.article.teaser');


The usage depends on how you define what being used means. If you mean with not used that it is not configured in a content type, which you can query in the config entities mentioned before, this doesn't mean necessarily, that the view mode is not used anywhere. If you configure an entity to be displayed in a view mode, for example in a View or a entity reference field, and this view mode is not configured in the content type, then it fallbacks to the default view mode.






share|improve this answer














View modes are stored in the configuration entity entity_view_mode which you can load like any other entity:



$view_mode = Drupal::entityTypeManager()
->getStorage('entity_view_mode')
->load('node.teaser');


To load all view modes for the entity type node:



$view_modes = Drupal::entityTypeManager()
->getStorage('entity_view_mode')
->loadByProperties(['targetEntityType' => 'node']);


View modes don't store much data other than a label for the view mode name.



How a view mode is displayed for a specific content type is stored in a different entity:



$display = Drupal::entityTypeManager()
->getStorage('entity_view_display')
->load('node.article.teaser');


The usage depends on how you define what being used means. If you mean with not used that it is not configured in a content type, which you can query in the config entities mentioned before, this doesn't mean necessarily, that the view mode is not used anywhere. If you configure an entity to be displayed in a view mode, for example in a View or a entity reference field, and this view mode is not configured in the content type, then it fallbacks to the default view mode.







share|improve this answer














share|improve this answer



share|improve this answer








edited Sep 6 at 20:35

























answered Sep 6 at 19:54









4k4

46.7k34985




46.7k34985











  • Just updated the question with definition of not being used
    – usernameabc
    Sep 6 at 20:33










  • If this is only for the usage between referenced content types you could load all displays like in the last code example and check the field formatter settings of all reference fields. But this would be only one of many places where view modes can be used.
    – 4k4
    Sep 6 at 21:18

















  • Just updated the question with definition of not being used
    – usernameabc
    Sep 6 at 20:33










  • If this is only for the usage between referenced content types you could load all displays like in the last code example and check the field formatter settings of all reference fields. But this would be only one of many places where view modes can be used.
    – 4k4
    Sep 6 at 21:18
















Just updated the question with definition of not being used
– usernameabc
Sep 6 at 20:33




Just updated the question with definition of not being used
– usernameabc
Sep 6 at 20:33












If this is only for the usage between referenced content types you could load all displays like in the last code example and check the field formatter settings of all reference fields. But this would be only one of many places where view modes can be used.
– 4k4
Sep 6 at 21:18





If this is only for the usage between referenced content types you could load all displays like in the last code example and check the field formatter settings of all reference fields. But this would be only one of many places where view modes can be used.
– 4k4
Sep 6 at 21:18













up vote
1
down vote













The configuration is stored in the config table



mysql> describe config;
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| collection | varchar(255) | NO | PRI | | |
| name | varchar(255) | NO | PRI | | |
| data | longblob | YES | | NULL | |
+------------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)


This is an example query from the umami demo profile:



 mysql> select name from config where name like 'core.entity_view_display.node.article.%';
+-------------------------------------------------------+
| name |
+-------------------------------------------------------+
| core.entity_view_display.node.article.card |
| core.entity_view_display.node.article.card_common |
| core.entity_view_display.node.article.card_common_alt |
| core.entity_view_display.node.article.default |
| core.entity_view_display.node.article.full |
| core.entity_view_display.node.article.rss |
| core.entity_view_display.node.article.teaser |
+-------------------------------------------------------+
7 rows in set (0.00 sec)





share|improve this answer






















  • This is an answer to the original question: "What is the name of the table where view modes are stored?" ... "Is there a database table where these View modes are stored? If so, what is the name of it?"
    – Cesar Moore
    Sep 6 at 20:58














up vote
1
down vote













The configuration is stored in the config table



mysql> describe config;
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| collection | varchar(255) | NO | PRI | | |
| name | varchar(255) | NO | PRI | | |
| data | longblob | YES | | NULL | |
+------------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)


This is an example query from the umami demo profile:



 mysql> select name from config where name like 'core.entity_view_display.node.article.%';
+-------------------------------------------------------+
| name |
+-------------------------------------------------------+
| core.entity_view_display.node.article.card |
| core.entity_view_display.node.article.card_common |
| core.entity_view_display.node.article.card_common_alt |
| core.entity_view_display.node.article.default |
| core.entity_view_display.node.article.full |
| core.entity_view_display.node.article.rss |
| core.entity_view_display.node.article.teaser |
+-------------------------------------------------------+
7 rows in set (0.00 sec)





share|improve this answer






















  • This is an answer to the original question: "What is the name of the table where view modes are stored?" ... "Is there a database table where these View modes are stored? If so, what is the name of it?"
    – Cesar Moore
    Sep 6 at 20:58












up vote
1
down vote










up vote
1
down vote









The configuration is stored in the config table



mysql> describe config;
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| collection | varchar(255) | NO | PRI | | |
| name | varchar(255) | NO | PRI | | |
| data | longblob | YES | | NULL | |
+------------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)


This is an example query from the umami demo profile:



 mysql> select name from config where name like 'core.entity_view_display.node.article.%';
+-------------------------------------------------------+
| name |
+-------------------------------------------------------+
| core.entity_view_display.node.article.card |
| core.entity_view_display.node.article.card_common |
| core.entity_view_display.node.article.card_common_alt |
| core.entity_view_display.node.article.default |
| core.entity_view_display.node.article.full |
| core.entity_view_display.node.article.rss |
| core.entity_view_display.node.article.teaser |
+-------------------------------------------------------+
7 rows in set (0.00 sec)





share|improve this answer














The configuration is stored in the config table



mysql> describe config;
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| collection | varchar(255) | NO | PRI | | |
| name | varchar(255) | NO | PRI | | |
| data | longblob | YES | | NULL | |
+------------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)


This is an example query from the umami demo profile:



 mysql> select name from config where name like 'core.entity_view_display.node.article.%';
+-------------------------------------------------------+
| name |
+-------------------------------------------------------+
| core.entity_view_display.node.article.card |
| core.entity_view_display.node.article.card_common |
| core.entity_view_display.node.article.card_common_alt |
| core.entity_view_display.node.article.default |
| core.entity_view_display.node.article.full |
| core.entity_view_display.node.article.rss |
| core.entity_view_display.node.article.teaser |
+-------------------------------------------------------+
7 rows in set (0.00 sec)






share|improve this answer














share|improve this answer



share|improve this answer








edited Sep 6 at 18:49

























answered Sep 6 at 18:41









Cesar Moore

561313




561313











  • This is an answer to the original question: "What is the name of the table where view modes are stored?" ... "Is there a database table where these View modes are stored? If so, what is the name of it?"
    – Cesar Moore
    Sep 6 at 20:58
















  • This is an answer to the original question: "What is the name of the table where view modes are stored?" ... "Is there a database table where these View modes are stored? If so, what is the name of it?"
    – Cesar Moore
    Sep 6 at 20:58















This is an answer to the original question: "What is the name of the table where view modes are stored?" ... "Is there a database table where these View modes are stored? If so, what is the name of it?"
– Cesar Moore
Sep 6 at 20:58




This is an answer to the original question: "What is the name of the table where view modes are stored?" ... "Is there a database table where these View modes are stored? If so, what is the name of it?"
– Cesar Moore
Sep 6 at 20:58

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdrupal.stackexchange.com%2fquestions%2f268886%2fwhat-is-the-name-of-the-table-where-view-modes-are-stored%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

Installing NextGIS Connect into QGIS 3?

One-line joke