Let's say that you want to hide the comments section on just one page of your MindTouch site because you want to avoid having people add comments to it. Here is how you would do it.
Once you have the block add the following to it:
<script type="text/jem">"
$('document').ready(function() {
$('#comments').css('display', 'none');
});
"</script>
<script type="text/jem">"
$('document').ready(function() {
if({{!user.admin}}){
$('#comments').css('display', 'none');
}
});
"</script>
Once you have the code right then you can load it into a Template and reference the template dynamically within the page. This will ensure that if someone edits the page that doesn't have rights to add unsafe html, that the override isn't removed.
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by