How to test a user role on public pages?

Hi,

We created a static page for reviewers and we put the link in the menu file (navbar.tpl).
We want that only reviewers can see this menu. So I added this code:
{if $isUserLoggedIn && $isValid.Reviewer.$journalId}
<a href="{url page=“pages” op=“view”}/reviewers">{translate key=“ubspecific.howSubmitReview”}
{/if}

The test “isUserLoggedIn” works fine but the test “isValid.Reviewer.$journalId” works only on pages that need authentications and not on public pages such as home page or articles pages.

Is there a way to test a user role on public pages ?

Thanks in advance for your answer.
Hélène

Hi @hcl,

I’d suggest using the Validation::isReviewer() function.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi,
It works fine!
Thanks a lot.
Hélène