Block only visible to admins...howto?

Ollibolli

Joined: 2005-12-20
Posts: 8
Posted: Fri, 2005-12-23 12:52

hello everyone,
i just started my first steps with gallery2 and adjusting themes.
but this smarty-thing is still strage to me...

i looked into theme.tpl (matrix-theme).
i only want the system links to be visible in the admin area.

i tried blocking the system link to a normal visitor:

{if $theme.pageType == 'admin'}
  <div class="gbSystemLinks">
          {g->block type="core.SystemLinks"
		    order="core.SiteAdmin core.YourAccount core.Login core.Logout"
		    othersAt=4}
        </div>
{/if}

but this does not seem to work; the system-links disappear forever, no matter what page you are on...

can you help me out? thanks a lot!

bye

 
Ollibolli

Joined: 2005-12-20
Posts: 8
Posted: Mon, 2005-12-26 16:00

just in case anyone might need it try:

{if $user.isAdmin}
...
{/if}

that's almost too easy ;)
using $theme.pageType is not a good idea, because it seems to change while the page is beeing built?