Skip to content

Instantly share code, notes, and snippets.

@scott

scott/buttons.js

Created Jul 24, 2018
Embed
What would you like to do?
Add 3 buttons to Helpy
<script>
$(document).ready(function(){
var button = function(url, icon, linked_text) {
var $icon = $('<i class="circle-icon"></i>')
.addClass(icon)
.css('color', '#666');
var $buttonLink = $("<a></a>")
.attr('href',url)
.append($icon)
.append("<br/>")
.append(linked_text);
return $("<div class='col-md-4 col-sm-4 col-xs-4 text-center article-icon'></div>").append($buttonLink);
}
$buttonBlock = $('<div id="featured-categories" class="row"></div>')
.append(button('/en/knowledgebase', 'fas fa-laptop', 'Knowledgebase'))
.append(button('/en/community', 'fas fa-comments', 'Community'))
.append(button('/en/topics/new', 'fas fa-comment', 'Open a Ticket'));
$($buttonBlock).insertAfter('#upper-wrapper'); // use .flat-main-panel for flat theme
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment