Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Category page example handling empty sub-sections
<div class="container-divider"></div>
<div class="container">
<nav class="sub-nav">
{{search submit=false scoped=true instant=true}}
<div class="category-container">
<div class="category-content">
<header class="page-header">
{{#if category.description}}
<p class="page-header-description">{{category.description}}</p>
<div class="section-tree">
{{#each sections}}
<section class="section">
<h3 class="section-tree-title">
<a href="{{url}}">{{name}}</a>
{{#if internal}}
<span class="icon-lock" title="{{t 'internal'}}"></span>
{{#if articles}}
<ul class="article-list">
{{#each articles}}
<li class="article-list-item{{#if promoted}} article-promoted{{/if}}">
{{#if promoted}}
<span data-title="{{t 'promoted'}}" class="icon-star"></span>
<a href="{{url}}" class="article-list-link">{{title}}</a>
{{#if more_articles}}
<a href="{{url}}" class="see-all-articles">
{{t 'show_all_articles' count=article_count}}
{{#if sections}}
<i class="section-empty">
<a href="{{url}}">{{t 'empty'}}</a>
<i class="category-empty">
<a href="{{category.url}}">{{t 'empty'}}</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.