Created
May 31, 2012 21:03
-
-
Save DeskSupport/2846259 to your computer and use it in GitHub Desktop.
Filter Portal by Topic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign _kb_topic_ids = '89110,89111,89112,89113,89114,89115,89116,89117,89118,89119,89120,89121,89122' %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($('form').hasClass('support-search-small')) | |
{ autocomplete_source += '?size=small&'; } | |
else | |
{ autocomplete_source += '?'; } if($('form').find('#kb_topic_ids').length > 0) { autocomplete_source += ('&kb_topic_ids=' + $('form').find('#kb_topic_ids').val() + '&'); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3>Help Articles</h3> | |
{% if topics_count > 0 %} | |
<table width='100%' cellspacing='0'> | |
{% for topic in topics %} {% capture _topic_id %}{{topic.id}}{% endcapture %} | |
{% if _kb_topic_ids contains _topic_id %} | |
{% if topic.article_count >0 %} | |
{% cycle 'open': '<tr><td>', '<td>' %} | |
<div class='topic topic{{ topic.id }}'> | |
<h4><a href='{{ topic.public_articles_url }}'>{{ topic.name }}</a></h4> {% if topic.article_count > 0 %} <ul> {% for article in topic.articles limit:3 %} <li> <a href='{{ article.public_url }}'>{{ article.subject_plain | clip:40 }}</a></li> | |
{% endfor %} | |
</ul> | |
<a class='pill' href='{{ topic.public_articles_url }}'> View all <strong>{{ topic.article_count }} {{ 'article' | pluralize: topic.article_count }}</strong> </a> | |
{% endif %} </div> | |
{% cycle 'close': '</td>', '</td></tr>' %} | |
{% endif %} | |
{% endif %} | |
{% endfor %} | |
</table> {% else %} <h4>No topics are available.</h4> {% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment