1
- {%- assign tools = site.data.tool_and_resource_list.Tools | where:"related_pages", include.tag %}
1
+ {%- assign tools = site.data.tool_and_resource_list | where:"related_pages", include.tag %}
2
+ {%- assign country_pages = site.pages | where_exp: "item", "item.search_exclude != true" | where_exp:"item","item.resources != nil" %}
2
3
{%- unless tools.size == 0 %}
4
+ {%- if include.tag %}
3
5
< h2 > Relevant tools and resources</ h2 >
6
+ {%- endif %}
4
7
< a class ="visually-hidden-focusable " href ='#skip-tool-table '> Skip tool table</ a >
5
8
< div class ="table-responsive mt-4 mb-5 ">
6
9
< table id ="tooltable " class ="table display ">
@@ -26,7 +29,6 @@ <h2>Relevant tools and resources</h2>
26
29
{%- assign total_county_tools = 0 %}
27
30
{%- assign instances_tool = 0 %}
28
31
{%- assign query = "related_pages." | append: page.type %}
29
- {%- assign country_pages = site.pages | where: "type", "national_resources" | where: "search_exclude", "false" %}
30
32
{%- for country_page in country_pages %}
31
33
{%- assign instance_matches = country_page.resources | where: "instance_of", tool.name | where_exp:"resource","resource.related_pages != nil" | where: query, include.tag %}
32
34
{%- assign tool_matches = country_page.resources | where_exp:"resource","resource.related_pages != nil" | where: query, include.tag %}
@@ -43,7 +45,7 @@ <h2>Relevant tools and resources</h2>
43
45
< td > {{tool.name}}</ td >
44
46
{%- endif %}
45
47
< td > {{tool.description}}
46
- {%- unless instances_tool == 0 or total_county_tools == 0 %}
48
+ {%- unless instances_tool == 0 or total_county_tools == 0 or include.tag == nil %}
47
49
< a href ="#national-resources-button " class ="d-block mt-1 ">
48
50
< span class ="badge text-white bg-primary "> < i class ="fas fa-arrow-circle-down me-2 "> </ i > Different instances available</ span >
49
51
</ a >
@@ -87,11 +89,15 @@ <h2>Relevant tools and resources</h2>
87
89
{%- endunless %}
88
90
{%- assign hide_ids = "resource_title" %}
89
91
{%- for country_page in country_pages %}
92
+ {%- if include.tag %}
90
93
{%- assign tool_matches = country_page.resources| where_exp:"resource","resource.related_pages != nil" | where: query, include.tag %}
94
+ {%- else %}
95
+ {%- assign tool_matches = country_page.resources %}
96
+ {%- endif %}
91
97
{%- for tool in tool_matches %}
92
98
{%- assign tool_id = tool.name | slugify %}
93
99
{%- assign hide_ids = hide_ids | append: " " | append: tool_id %}
94
- < tr class ="collapse multi-collapse " id ="{{tool_id}} ">
100
+ < tr {% unless include.tag == nil %} class ="collapse multi-collapse " id ="{{tool_id}} "{% endunless %} >
95
101
{% if tool.url %}
96
102
< td > < a href ="{{tool.url}} "> {{tool.name}}</ a > < a href ="{{country_page.url}} " data-bs-toggle ="tooltip " title ="{{country_page.title}} "> < span class ="flag-icon ms-2 flag-icon-{{country_page.country_code | downcase }} "> </ span > </ a > </ td >
97
103
{%- else %}
@@ -131,7 +137,7 @@ <h2>Relevant tools and resources</h2>
131
137
</ tbody >
132
138
</ table >
133
139
</ div >
134
- {%- unless total_county_tools == 0 %}
140
+ {%- unless total_county_tools == 0 or include.tag == nil %}
135
141
< a class ="btn btn-primary " id ="national-resources-button " data-bs-toggle ="collapse " data-bs-target =".multi-collapse " role ="button " aria-expanded ="false " aria-controls ="{{hide_ids}} ">
136
142
View national resources < span class ="badge bg-white text-primary ms-2 "> {{total_county_tools}}</ span >
137
143
</ a >
0 commit comments