Enable article preview below title
AnsweredWhat do I need to do to display a preview of a support article above the title of article when it displays in a list format on a section or category page using the Copenhagen theme?
1 Comments
-
Hi Henry,
If you're looking to show the first few lines of the article on a section page you could do that with some minor theme customization.
Following the linked instructions, edit your theme's section_page.hbs file, look for the block of code below and add the line in bold:
{{#if section.articles}}
<ul class="article-list">
{{#each section.articles}}
<li class="article-list-item {{#if promoted}} article-promoted{{/if}}">
{{#if promoted}}
<span data-title="{{t 'promoted'}}" class="icon-star"></span>
{{/if}}
<a href="{{url}}" class="article-list-link">{{title}}</a>
{{#if internal}}
<span class="icon-lock" title="{{t 'internal'}}"></span>
{{/if}}
<p class="excerpt">{{excerpt body}}</p>
</li>
{{/each}}
</ul>
{{else}}
<i class="section-empty">
<a href="{{section.url}}">{{t 'empty'}}</a>
</i>
{{/if}}This shows the first 120 characters of each article. You could go higher if needed by using f.e.:
<p class="excerpt">{{excerpt body characters=200}}</p>
I'm assuming you're on a stock Copenhagen theme but the same principles apply to other themes as well.
Hope that helps!
Please sign in to leave a comment.