Skip to content

Instantly share code, notes, and snippets.

@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 / document head.html
Last active August 13, 2020 21:22
Zendesk: Alert Notification with Promoted Articles
//Link to Font Awesome for the icon
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
@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();
@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
Created December 17, 2014 16:35
Zendesk: Change text of Promoted Articles
//Change text of Promoted Articles
$("h3:contains('Promoted articles')").text('Important Information');
@moderatorwes
moderatorwes / zendesk.js
Last active August 29, 2015 14:07
Zendesk: Remove Author and replace with another author
//Remove author from articles
$(".article-author").first("a").html(
$(".article-author").first("a").html().replace("Inactive Agent", "Support Team")
);
@moderatorwes
moderatorwes / zendesk.js
Created October 17, 2014 19:40
Zendesk: Change voting wording if article is in a certain category
//Change wording of voting controls if article is in a certain category
if ($('.breadcrumbs li:nth-child(2) :contains("Technical")').size() == 1) {
$('.article-vote-question').text("Do you like this");
}
else{
$('.article-vote-question').text("Was this article helpful");
}