FEATURE: Add links to subcategories page on category page (#29474)

This applies only to the optimized category page style.
This commit is contained in:
Bianca Nenciu 2024-10-29 20:47:46 +02:00 committed by GitHub
parent 5cc531ed75
commit 9a80d71882
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 38 additions and 0 deletions

View File

@ -28,6 +28,16 @@
{{dir-span this.category.description_excerpt htmlSafe="true"}}
</div>
{{/if}}
{{#if (gt this.category.subcategories.length 0)}}
<div class="category-subcategories">
<LinkTo @route="discovery.subcategories" @model={{this.slugPath}}>
{{i18n
"category_row.subcategory_count"
count=this.category.subcategories.length
}}
</LinkTo>
</div>
{{/if}}
</td>
<td class="topics">

View File

@ -23,6 +23,18 @@
</td>
</tr>
{{/if}}
{{#if (gt this.category.subcategories.length 0)}}
<tr class="category-subcategories">
<td colspan="3">
<LinkTo @route="discovery.subcategories" @model={{this.slugPath}}>
{{i18n
"category_row.subcategory_count"
count=this.category.subcategories.length
}}
</LinkTo>
</td>
</tr>
{{/if}}
</tbody>
</table>
</div>

View File

@ -314,6 +314,14 @@
overflow: hidden;
color: var(--primary-high);
}
.category-subcategories {
font-size: var(--font-down-1);
margin-top: 0.5em;
a {
color: var(--primary-high);
}
}
.category-logo.aspect-image {
margin-top: 0.5em;
}

View File

@ -265,6 +265,14 @@ tr.category-topic-link {
padding-bottom: 15px;
}
.category-subcategories td {
padding-top: 0;
}
.category-description + .category-subcategories td {
padding-top: 0;
}
.subcategories-list {
border-bottom: none;
td {