Maybe this can help someone:
You can also use jquery:
This would go into the HTML widget:
<span class="offtopic_forbidden">Off-topic is strictly forbidden.</span>
<script>
if (ajaxify.currentPage != 'category/14/staff-recruitment') {
$('.offtopic_forbidden').hide()
}
</script>
And this would be the container:
<div class="alert ui-draggable-handle alert-danger offtopic_forbidden">{{body}}</div>
Adjust 'category/14/staff-recruitment' to your needs.
-
$('.offtopic_forbidden')
is a jquery selector, it selects the DOM element with the class .offtopic_forbidden -
The function .hide() hides it.
Additional info:
-
You can use another type of container, but be sure to add the class to it.
-
You can also rename
offtopic_forbidden
to your needs.