visible_for_admins

NAML documentation   Watch a video
   Usages of this macro
Shows the HTML elements returned by the selector parameter if the current visitor is an administrator. This is very helpful in cached pages, where you can't use the visitor command. So the solution is to use javascript to perform this check.
... in utilities.naml
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
<macro name="visible_for_admins" parameters="selector">
    <n.put_in_head
Binary
Namespace: HtmlNamespace
Parameters: in_head
.>
        <n.array_of_user_ids
Macro
Parameters: var_name, group
 var_name="site_admins" group="[n.administrators_group
Binary
Namespace: NabbleNamespace
/]"/>
    </n.put_in_head.>
    <script type="text/javascript">
        $(document).ready(function() {
            if (Nabble.userId && site_admins.indexOf(Number(Nabble.userId)) >= 0)
                $('<n.selector/>').show();
        });
    </script>
</macro>