In D8, I want to display a view through quicktabs. For this, at first I have created a view file and call the view through QT. The view is displays well through QT. Now, I want to change the look & feel of the view. Please look into the screen of view which I've created before.
Now, based on the below theme suggestions I created the file block--quicktabs-block--gallery-tab.html.twig
to override and place it under the "templates" folder in my theme.
<!-- FILE NAME SUGGESTIONS:
* block--quicktabsgallerytab.html.twig
* block--quicktabs-block--gallery-tab.html.twig
* block--quicktabs-block.html.twig
* block--quicktabs.html.twig
x block.html.twig
-->
When I write something fixed like "Hello Test" in the block--quicktabs-block--gallery-tab.html.twig
, its showing well. However, when I tried to do something dynamic coding like below, nothing appeared.
{% if title %}
<h3>{{ title }}</h3>
{% endif %}
{% for key, row in rows %}
{% if key in rows_with_tabs %}
{{ tabs }}
<div class="quicktabs-main" id="quicktabs-container-{{ quicktab_id }}">
{% endif %}
{% if key in rows_with_page_starts %}
{% for page_key, page in rows_with_page_starts %}
{% if key == page %}
<div class="quicktabs-tabpage{{ page_key > 0 ? ' quicktabs-hide' : '' }}" id="quicktabs-tabpage-{{ quicktab_id }}-{{ page_key }}"> <!-- start of tbapage -->
{% set page_number = page_key %}
{% endif %}
{% endfor %}
{% endif %}
{{ row.content }}
{% if key in rows_with_page_endings %}
{# close .quicktabs-tabpage #}
</div>
{% endif %}
{% if key == last_index %}
{# close .quicktabs-main #}
</div>
{% endif %}
{% endfor %}
Am I overriding the correct file? Any suggestion?
PS: after implementing the template file as said above, the suggestions looks like:
<!-- FILE NAME SUGGESTIONS:
* block--quicktabsgallerytab.html.twig
x block--quicktabs-block--gallery-tab.html.twig
* block--quicktabs-block.html.twig
* block--quicktabs.html.twig
* block.html.twig
-->
FILE NAME SUGGESTIONS:
changed with x next to your template ?block--quicktabs-block--gallery-tab.html.twig
as said above.FILE NAME SUGGESTIONS
should have a line like thisx block--quicktabs-block--gallery-tab.html.twig
the x should be on the line of your template, meaning it is using this templateFILE NAME SUGGESTIONS:
above the x is next toblock.html.twig
. Did it change place after you included your template and cleared cache ? Its an indicator of which twig template is used.