You are here

loader.html.twig in Bamboo Twig 8.2

<div class="test-loaders">


  <!-- Get Current User -->
  <h2>Current User</h2>
  <hr>
  {% set user = bamboo_load_currentuser() %}
  <div class="loader-current-user">{{ user.name.value }}</div>

  <!-- Loader Entity -->
  <h2>Loader Entity</h2>
  <hr>
  {% set article = bamboo_load_entity('node', 1) %}
  <div class="loader-entity-node">{{ article.title.value }}</div>
  {% set term = bamboo_load_entity('taxonomy_term', 1) %}
  <div class="loader-entity-taxonomy-term">{{ term.name.value }}</div>
  {% set file = bamboo_load_entity('file', 1) %}
  <div class="loader-entity-file">{{ file.filename.value }}</div>
  {% set user = bamboo_load_entity('user', 1) %}
  <div class="loader-entity-user">{{ user.name.value }}</div>

  <!-- Loader Field -->
  <h2>Loader Field</h2>
  <hr>
  {% set article_title = bamboo_load_field('title', 'node', 1) %}
  <div class="loader-field-node">{{ article_title.value }}</div>
  {% set term_name = bamboo_load_field('name', 'taxonomy_term', 1) %}
  <div class="loader-field-taxonomy-term">{{ term_name.value }}</div>
  {% set filename = bamboo_load_field('filename', 'file', 1) %}
  <div class="loader-field-file">{{ filename.value }}</div>
  {% set username = bamboo_load_field('name', 'user', 1) %}
  <div class="loader-field-user">{{ username.value }}</div>

  <!-- Loader Image -->
  <h2>Loader Image</h2>
  <hr>
  {% set image = bamboo_load_image('public://antistatique.png') %}
  <div class="loader-image-uri">{{ image.source }}</div>
  {% set image = bamboo_load_image('modules/contrib/bamboo_twig/tests/modules/bamboo_twig_test/files/antistatique.png') %}
  <div class="loader-image-path">{{ image.source }}</div>
</div>

File

tests/modules/bamboo_twig_test/templates/loader.html.twig
View source
  1. <div class="test-loaders">
  2. <!-- Get Current User -->
  3. <h2>Current User</h2>
  4. <hr>
  5. {% set user = bamboo_load_currentuser() %}
  6. <div class="loader-current-user">{{ user.name.value }}</div>
  7. <!-- Loader Entity -->
  8. <h2>Loader Entity</h2>
  9. <hr>
  10. {% set article = bamboo_load_entity('node', 1) %}
  11. <div class="loader-entity-node">{{ article.title.value }}</div>
  12. {% set term = bamboo_load_entity('taxonomy_term', 1) %}
  13. <div class="loader-entity-taxonomy-term">{{ term.name.value }}</div>
  14. {% set file = bamboo_load_entity('file', 1) %}
  15. <div class="loader-entity-file">{{ file.filename.value }}</div>
  16. {% set user = bamboo_load_entity('user', 1) %}
  17. <div class="loader-entity-user">{{ user.name.value }}</div>
  18. <!-- Loader Field -->
  19. <h2>Loader Field</h2>
  20. <hr>
  21. {% set article_title = bamboo_load_field('title', 'node', 1) %}
  22. <div class="loader-field-node">{{ article_title.value }}</div>
  23. {% set term_name = bamboo_load_field('name', 'taxonomy_term', 1) %}
  24. <div class="loader-field-taxonomy-term">{{ term_name.value }}</div>
  25. {% set filename = bamboo_load_field('filename', 'file', 1) %}
  26. <div class="loader-field-file">{{ filename.value }}</div>
  27. {% set username = bamboo_load_field('name', 'user', 1) %}
  28. <div class="loader-field-user">{{ username.value }}</div>
  29. <!-- Loader Image -->
  30. <h2>Loader Image</h2>
  31. <hr>
  32. {% set image = bamboo_load_image('public://antistatique.png') %}
  33. <div class="loader-image-uri">{{ image.source }}</div>
  34. {% set image = bamboo_load_image('modules/contrib/bamboo_twig/tests/modules/bamboo_twig_test/files/antistatique.png') %}
  35. <div class="loader-image-path">{{ image.source }}</div>
  36. </div>