Skip to content

Instantly share code, notes, and snippets.

@moderatorwes
moderatorwes / zendesk.js
Created December 18, 2014 17:04
Zendesk: Section Tree with Article
// Removing the article dropdown
$('.article-list a[aria-selected]').removeAttr('aria-selected').removeAttr('data-asynchtml-ressource')
});
@moderatorwes
moderatorwes / zendesk.js
Last active June 29, 2016 18:18
Zendesk: Show less than 6 articles
//Step by Step article located here: https://support.zendesk.com/entries/31041636-Show-less-than-6-articles-in-a-section-in-Help-Center
//Show less than 6 articles
if( document.location.href.indexOf('section') == -1 ) {
var categories = $('ul.article-list');
for (var j = categories.length - 1; j >= 0; j--) {
var articles = $(categories[j]).find('li'),
nativeMore = $(categories[j]).siblings('.see-all-articles');
if ( articles.length > 3 ) {
for (var k = 3; k < articles.length; k++ ) {
$(articles[k]).hide();
@moderatorwes
moderatorwes / zendesk.js
Last active March 2, 2016 14:44
Zendesk: Hide Articles List on HomePage
if (window.location.href == "https://yoururl.zendesk.com/hc/en-us") {
$('ul.article-list').hide();
}
@moderatorwes
moderatorwes / zendesk.js
Created February 16, 2016 14:01
Zendesk: Limit number of promoted articles
//Limit number of promoted articles on homepage
if(typeof $('.promoted-articles ul').get(0) != 'undefined') {
var _sectionArticles = $('.promoted-articles ul');
_sectionArticles.each(function(_aidx, _aitm) {
var _itmCount = $(_aitm).find('li').length;
var _allLink = $(_aitm).prev('h3').find('a').attr('href');
if(_itmCount > 5) {
for(var x = (_itmCount - 1); x > 4; x--) {
$($(_aitm).find('li')[x]).remove();
}
@moderatorwes
moderatorwes / zendesk.js
Created January 22, 2016 02:55
Zendesk: Make Humble Squid boxes clickable
//Humble Squid boxes clickable
$(".category-list li:has(a)").click(function() {
window.location = $("a:first",this).attr("href");
});
$(".category-list li").css('cursor', 'pointer');
@moderatorwes
moderatorwes / zendesk.js
Created May 19, 2015 00:42
Zendesk: Limit the number of Promoted Articles
//Only show five promoted articles
$(document).ready(function () {
if(typeof $('.promoted-articles ul').get(0) != 'undefined') {
var _sectionArticles = $('.promoted-articles ul');
_sectionArticles.each(function(_aidx, _aitm) {
var _itmCount = $(_aitm).find('li').length;
var _allLink = $(_aitm).prev('h3').find('a').attr('href');
if(_itmCount > 5) {
for(var x = (_itmCount - 1); x > 4; x--) {
$($(_aitm).find('li')[x]).remove();
@moderatorwes
moderatorwes / Zendesk.html
Last active August 29, 2015 14:16
Zendesk: Add FontAwesome icons beside Promited Articles Titles
<!--This code goes in your document head -->
<!-- Font Awesome -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
@moderatorwes
moderatorwes / zendesk.css
Last active August 29, 2015 14:15
Zendesk: Add video icon beside Title
/*Custom CSS for Video Icons on ArticleList */
.video:before{
content: "\f1c8";
color: #585858;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
text-decoration: none;
font-size: 18px;
}
@moderatorwes
moderatorwes / zendesk.js
Created January 29, 2015 18:15
Zendesk - Adding text under Title for Humble Squid theme
//Adding text under Title for Humble Squid theme
$( ".category-list li:nth-child(1) a " ).after( "<p>description 1 goes here</p> " );
$( ".category-list li:nth-child(2) a" ).after( "<p>description 2 goes here</p> ");
$( ".category-list li:nth-child(3) a" ).after( "<p>description 3 is a really really realy really really long description </p> " );
@moderatorwes
moderatorwes / zendesk.js
Created December 18, 2014 17:39
Zendesk: Related Articles & Recently Viewed Articles show only 4
//Hiding the 5th and 6th so only 4 will show
$( "section.related-articles li:nth-child(5)" ).hide();
$( "section.related-articles li:nth-child(6)" ).hide();