You are here

scanner-results.html.twig in Search and Replace Scanner 8

<div>
  <strong>Search Results:</strong><br />
  <span>Found {{data.count}} matches.</span>
  {% for content_type, bundles in data.values %}
    {% for bundle, fields in bundles %}
      <h2>{{content_type | capitalize}} - {{bundle | capitalize}}</h2>
      {% for field, values in fields %}
        <h5>Field: {{field}}</h5>
        <ol>
          {% for id, value in values %}
            <li>
              {{value.title}} | 
              <a href="{{ path('entity.node.canonical', {'node':id}) }}">view</a> | 
              <a href="/node/{{id}}/edit">edit</a>
            </li>
            {% if value.field|length > 1 %}
              <span>[{{value.field|length}} matches in the field]</span>
            {% else %}
              <span>[{{value.field|length}} match in the field]</span>
            {% endif %}
            <ul>
              {% for idx, item in value.field %}
                <li>{{ item|striptags('<strong>')|raw }}</li>
              {% endfor %}
            </ul>
          {% endfor %}
        </ol>
      {% endfor %}
    {% endfor %}
  {% endfor %}
</div>

File

templates/scanner-results.html.twig
View source
  1. <div>
  2. <strong>Search Results:</strong><br />
  3. <span>Found {{data.count}} matches.</span>
  4. {% for content_type, bundles in data.values %}
  5. {% for bundle, fields in bundles %}
  6. <h2>{{content_type | capitalize}} - {{bundle | capitalize}}</h2>
  7. {% for field, values in fields %}
  8. <h5>Field: {{field}}</h5>
  9. <ol>
  10. {% for id, value in values %}
  11. <li>
  12. {{value.title}} |
  13. <a href="{{ path('entity.node.canonical', {'node':id}) }}">view</a> |
  14. <a href="/node/{{id}}/edit">edit</a>
  15. </li>
  16. {% if value.field|length > 1 %}
  17. <span>[{{value.field|length}} matches in the field]</span>
  18. {% else %}
  19. <span>[{{value.field|length}} match in the field]</span>
  20. {% endif %}
  21. <ul>
  22. {% for idx, item in value.field %}
  23. <li>{{ item|striptags('<strong>')|raw }}</li>
  24. {% endfor %}
  25. </ul>
  26. {% endfor %}
  27. </ol>
  28. {% endfor %}
  29. {% endfor %}
  30. {% endfor %}
  31. </div>