Using HelpDocs with RTL Languages

The HelpDocs text editor has a button you can click to switch text direction for RTL (right-to-left) languages like Hebrew. But there's some other parts of your template you'll want to edit to make everything appear in the right (pun intended) direction.

River Sloane
Updated by River Sloane

The HelpDocs text editor will automatically switch text direction for RTL (right-to-left) languages like Hebrew when you start typing in those languages. But there's some other parts of your template you'll want to edit to make everything appear in the right (pun intended) direction.

These snippets have been tested with the Boxed (v3next) template. If you're using another template there may be other customizations required.

Our latest templates now support RTL out of the box 📦

The CSS

Paste this snippet into SettingsCode > CSS.
#main[data-hd-template="boxedinstantv3"] #header input {
padding-right: 3em !important;
}
@media (min-width: 70em) {
#header #search-container.search-responsive span {
margin-right: 6em !important;
}
#article .card.responsive-toc {
margin-right: 0px !important;
margin-left: 0px !important;
}
}
#article .tip-callout::before,
#article .note-callout::before,
#article .warning-callout::before {
margin-right: 40px !important;
}
#article .tip-callout,
#article .note-callout,
#article .warning-callout {
border-right-width: 5px !important;
border-left-width: 0 !important;
}

The JavaScript

Paste this snippet into Settings > Code > Javascript
<script type="text/javascript">
(function() {
$(function() {
// This assumes you're using the code in a multilingual setup, converting Hebrew to RTL.
// Contact HelpDocs support if you have trouble modifying it for your exact settings!
if ($('body').data().languageCode === 'he') {
$('html').attr('dir', 'rtl');
$('.dropdown-menu-right').removeClass('dropdown-menu-right');
$('#article #body p.meta').css('display', 'none !important;');
$('#category #articles p.card-text img').css('display', 'none !important;');
$('#category #articles p.card-text .text-muted').css('display', 'none !important;');
$('#home #categories #category p.card-text:last-of-type').css('display', 'none !important;');
}
});
})();
</script>

What did you think of this doc?

Making Video Embeds Responsive

Condense Top Article Spacing on Bars V4

Get in touch

This site is protected by hCaptcha and its Privacy Policy and Terms of Service apply.