description.html.twig

Same filename in this branch
  1. 4.0.x modules/menu_example/templates/description.html.twig
  2. 4.0.x modules/form_api_example/templates/description.html.twig
  3. 4.0.x modules/js_example/templates/description.html.twig
  4. 4.0.x modules/page_example/templates/description.html.twig
  5. 4.0.x modules/pager_example/templates/description.html.twig
  6. 4.0.x modules/block_example/templates/description.html.twig
  7. 4.0.x modules/tabledrag_example/templates/description.html.twig
  8. 4.0.x modules/rest_example/templates/description.html.twig
  9. 4.0.x modules/testing_example/templates/description.html.twig
  10. 4.0.x modules/tour_example/templates/description.html.twig
  11. 4.0.x modules/config_entity_example/templates/description.html.twig
  12. 4.0.x modules/phpunit_example/templates/description.html.twig
  13. 4.0.x modules/render_example/templates/description.html.twig
  14. 4.0.x modules/field_permission_example/templates/description.html.twig
  15. 4.0.x modules/stream_wrapper_example/templates/description.html.twig
  16. 4.0.x modules/ajax_example/templates/description.html.twig
  17. 4.0.x modules/hooks_example/templates/description.html.twig
  18. 4.0.x modules/field_example/templates/description.html.twig
  19. 4.0.x tests/modules/examples_description_test/templates/description.html.twig
  20. 4.0.x modules/config_simple_example/templates/description.html.twig
Same filename in other branches
  1. 3.x modules/menu_example/templates/description.html.twig
  2. 3.x modules/form_api_example/templates/description.html.twig
  3. 3.x modules/js_example/templates/description.html.twig
  4. 3.x modules/page_example/templates/description.html.twig
  5. 3.x modules/node_type_example/templates/description.html.twig
  6. 3.x modules/pager_example/templates/description.html.twig
  7. 3.x modules/block_example/templates/description.html.twig
  8. 3.x modules/tabledrag_example/templates/description.html.twig
  9. 3.x modules/rest_example/templates/description.html.twig
  10. 3.x modules/testing_example/templates/description.html.twig
  11. 3.x modules/tour_example/templates/description.html.twig
  12. 3.x modules/config_entity_example/templates/description.html.twig
  13. 3.x modules/phpunit_example/templates/description.html.twig
  14. 3.x modules/render_example/templates/description.html.twig
  15. 3.x modules/field_permission_example/templates/description.html.twig
  16. 3.x modules/stream_wrapper_example/templates/description.html.twig
  17. 3.x modules/ajax_example/templates/description.html.twig
  18. 3.x modules/hooks_example/templates/description.html.twig
  19. 3.x modules/field_example/templates/description.html.twig
  20. 3.x tests/modules/examples_description_test/templates/description.html.twig
  21. 8.x-1.x menu_example/templates/description.html.twig
  22. 8.x-1.x form_api_example/templates/description.html.twig
  23. 8.x-1.x js_example/templates/description.html.twig
  24. 8.x-1.x page_example/templates/description.html.twig
  25. 8.x-1.x node_type_example/templates/description.html.twig
  26. 8.x-1.x pager_example/templates/description.html.twig
  27. 8.x-1.x block_example/templates/description.html.twig
  28. 8.x-1.x tabledrag_example/templates/description.html.twig
  29. 8.x-1.x testing_example/templates/description.html.twig
  30. 8.x-1.x tour_example/templates/description.html.twig
  31. 8.x-1.x config_entity_example/templates/description.html.twig
  32. 8.x-1.x tests/modules/examples_description_test/templates/description.html.twig
  33. 8.x-1.x phpunit_example/templates/description.html.twig
  34. 8.x-1.x render_example/templates/description.html.twig
  35. 8.x-1.x field_permission_example/templates/description.html.twig
  36. 8.x-1.x stream_wrapper_example/templates/description.html.twig
  37. 8.x-1.x ajax_example/templates/description.html.twig
  38. 8.x-1.x hooks_example/templates/description.html.twig
  39. 8.x-1.x field_example/templates/description.html.twig
{#

Description text for the Node type Example.

#}


{% set content_type_path = path('entity.node_type.collection') %}
{% set add_types = path ('node.type_add') %}

{% trans %}


<p>Config Node Type Example is a basic example of defining a content type through configuration YAML files.</p>
<p>In this example we create two content types for Drupal 8, using only YAML files. Well, mostly only YAML files...
    One of our content types is locked, so the user can&#39;t delete it while the module is installed. For this we need
    a very tiny amount of support code.</p>
<p>You can observe these content types on <a href= {{ content_type_path }}>the content type admin page</a>.</p>
<p>The simplest way to author the per-type YAML files is to create the content types within Drupal and then take the
    YAML files from the configuration directory. Like this:</p>
<ul>
    <li>Install Drupal 8.</li>
    <li>Create a new content type at {{ add_types }}. Let&#39;s call it &#39;Nifty Content Type&#39;.</li>
    <li>Export the configuration from <code>admin/config/development/configuration</code>. Specific steps depending
        on needs, and decisions made during Drupal 8 beta. You&#39;ll see a file called
        <code>node.type.nifty_content_type.yml</code>.</li>
    <li>Copy or move that file to your module&#39;s <code>config/install</code> directory, along with associated field
        and form yml files.</li>
    <li>Remove the uuid information from the configuration files.</li>
</ul>
<p>You can see some of these YAML files in this module&#39;s <code>config/install</code> directory.</p>
<p>If you want to lock a content type created in this way, you&#39;ll have to implement <code>hook_install()</code> and
    <code>hook_uninstall()</code>. In <code>hook_install()</code>, you&#39;ll set the content type to be locked.
    In <code>hook_uninstall()</code> you&#39;ll set the content type to be unlocked.</p>
<p>Content types created in this way will remain available after the user has uninstalled the module.
    If you were to fail to set the content type as unlocked, the user would not be able to delete it.</p>
<p>This example is based on this change notification: <a href="https://drupal.org/node/2029519">https://drupal.org/node/2029519</a></p>

{% endtrans %}

File

modules/node_type_example/templates/description.html.twig

View source
  1. {#
  2. Description text for the Node type Example.
  3. #}
  4. {% set content_type_path = path('entity.node_type.collection') %}
  5. {% set add_types = path ('node.type_add') %}
  6. {% trans %}
  7. <p>Config Node Type Example is a basic example of defining a content type through configuration YAML files.</p>
  8. <p>In this example we create two content types for Drupal 8, using only YAML files. Well, mostly only YAML files...
  9. One of our content types is locked, so the user can&#39;t delete it while the module is installed. For this we need
  10. a very tiny amount of support code.</p>
  11. <p>You can observe these content types on <a href= {{ content_type_path }}>the content type admin page</a>.</p>
  12. <p>The simplest way to author the per-type YAML files is to create the content types within Drupal and then take the
  13. YAML files from the configuration directory. Like this:</p>
  14. <ul>
  15. <li>Install Drupal 8.</li>
  16. <li>Create a new content type at {{ add_types }}. Let&#39;s call it &#39;Nifty Content Type&#39;.</li>
  17. <li>Export the configuration from <code>admin/config/development/configuration</code>. Specific steps depending
  18. on needs, and decisions made during Drupal 8 beta. You&#39;ll see a file called
  19. <code>node.type.nifty_content_type.yml</code>.</li>
  20. <li>Copy or move that file to your module&#39;s <code>config/install</code> directory, along with associated field
  21. and form yml files.</li>
  22. <li>Remove the uuid information from the configuration files.</li>
  23. </ul>
  24. <p>You can see some of these YAML files in this module&#39;s <code>config/install</code> directory.</p>
  25. <p>If you want to lock a content type created in this way, you&#39;ll have to implement <code>hook_install()</code> and
  26. <code>hook_uninstall()</code>. In <code>hook_install()</code>, you&#39;ll set the content type to be locked.
  27. In <code>hook_uninstall()</code> you&#39;ll set the content type to be unlocked.</p>
  28. <p>Content types created in this way will remain available after the user has uninstalled the module.
  29. If you were to fail to set the content type as unlocked, the user would not be able to delete it.</p>
  30. <p>This example is based on this change notification: <a href="https://drupal.org/node/2029519">https://drupal.org/node/2029519</a></p>
  31. {% endtrans %}