Node http://lobsterr.me/ en How list content types (entity bundles list) in Drupal? http://lobsterr.me/post/how-list-content-types-entity-bundles-list-drupal <span class="field field--name-title field--type-string field--label-hidden">How list content types (entity bundles list) in Drupal?</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">LOBsTerr</span></span> <span class="field field--name-created field--type-created field--label-hidden">09/16/2019</span> <div class="field field--name-f-content field--type-entity-reference-revisions field--label-hidden field__items"> <div class="field__item"> <div class="paragraph paragraph--type--l-text paragraph--view-mode--default"> <div class="clearfix text-formatted field field--name-f-text field--type-text-long field--label-hidden field__item"><p>To get list of content types (entity bundles) in Drupal 8, we need to call entity storage and load all available items</p> <pre> <code class="language-php">$node_types = \Drupal::entityTypeManager() -&gt;getStorage('node_type') -&gt;loadMultiple();</code></pre> </div> </div> </div> </div> <div class="field field--name-f-tags field--type-entity-reference field--label-hidden field__items"> <div class="field__item btn btn-secondary"><a href="/tags/node" hreflang="en">Node</a></div> <div class="field__item btn btn-secondary"><a href="/tags/drupal-9" hreflang="en">Drupal 9</a></div> <div class="field__item btn btn-secondary"><a href="/tags/entity-api" hreflang="en">Entity API</a></div> </div> <section class="field field--name-f-comments field--type-comment field--label-above comment-wrapper"> </section> Mon, 16 Sep 2019 11:10:20 +0000 LOBsTerr 15 at http://lobsterr.me