Pagesetter » Permissions hardcoded in template

Information

Below is an example of how you can show the "number of hits" of an item only to users with "edit" permissions in pagesetter.

Credits: alpo3

UPDATE 28/7/2005:
<font class="f12pix"> Placing any publication variables (except $core.hitCount, $core.editThis and $core.editInfo) within "nocache" tags will cause those variables only to be displayed the first time the page is loaded (or, more technically, whenever the cache template is created, or re-created after the cache expires). Currently, the only way to successfully use publication variables (or fields) in non-cached output is to create your own plug-in. (Thanks for the tip, Blake.) Of course, if you simply want to show the "hit count" or the "edit this" links -- or if you want to display static text or images -- to users who have permission, then the above example should help you out.</font>

Code Snippets

For Postnuke [pre-Zikula]

Code

<!--[nocache]-->
<!--[pnsecauthaction realm="0" comp="pagesetter::" inst="::" level="ACCESS_EDIT" assign="auth"]-->
<!--[if $auth]-->
 <!--[$core.hitCount]--> hits
<!--[/if]-->
<!--[/nocache]-->
For Zikula 1.x

Code

<!--[securityutil_checkpermission component="pagesetter::" instance="::" level="ACCESS_EDIT" assign="auth"]-->
Only logged in users are allowed to comment. register/log in