Skip to content

Instantly share code, notes, and snippets.

@DeskWOW
Last active October 6, 2017 20:03
Show Gist options
  • Save DeskWOW/006af7f86f1793fa301f0c02bb895f2d to your computer and use it in GitHub Desktop.
Save DeskWOW/006af7f86f1793fa301f0c02bb895f2d to your computer and use it in GitHub Desktop.
Topic/Subtopic Desk Theme hack. Place on Page (Index) in Advanced Theme Editor.
<div id="content">
<div class="container index">
<div class="row">
<div class="col-md-12">
<div class="col-md-8 {% if desk.page.theme.layout != 'left' %} col-md-push-4 {% endif %}">
<div class="row topic">
{% assign col = 0 %}
{%for topic in topics%}
{%if topic.desc contains 'heading' and col == 0 %}
</div><div class="row topic">
{% endif %}
{% if topic.desc == 'heading' %}
<h2 class="subheader col-md-12">{{ topic.name }}</h2>
</div><div class="row topic">
{% assign col = 0 %}
{% else %}
<div class="desk-topic desk-topic-{{ topic.id }} col-md-6">
<h3><a href='{{topic.public_articles_url}}'>{{ topic.name }}</a></h3>
<ul>
{% for article in topic.articles limit:5 %}
<li><a href='{{article.public_url}}'>{{ article.subject_plain }}</a></li>
{% endfor %}
</ul>
<a class="btn btn-pill" href='{{topic.public_articles_url}}'><span class="desk-view-text">{{system.snippets.view_all}}</span> {{ topic.article_count }}</a>
</div>
{% if col == 2 %}
</div><div class="row topic">
{%assign col = 0 %}
{%else%}
{% assign col = 2 %}
{%endif%}
{% endif %}
{%endfor%}
</div>
</div><!--Index Col 8 -->
<!--SIDEBAR -->
{{ sidebar_main }} <!--SIDEBAR -->
</div><!-- Main Row-->
</div><!--Container-->
</div><!--Content-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment