I'm using a few PHP pages outside my G2 application, which rely on the G2 embed functionality to work.
I'm trying to only display the admin link when admin users are logged-in, but cannot find a way in PHP to do include in an IF statement along the lines of:
if(youareanadminuser) {showlink};
Thanks
Posts: 32509
please see the user specific variables at documentation -> development -> themes -> variables.
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 14
Unfortunately for me - that documentation is written around doing the above in smarty, whereas I need to do it in PHP.
So the smarty docs say something like:
{if $user.isAdmin}
something
{/if}
But if I try what I think is the equivalent in a PHP page outside of G2 it doesn't work:
if ($user.isAdmin){
something
}
Posts: 14
I had the same issue and found the result on the forum elsewhere - do this in PHP:
Thought I'd post it as most questions re. $isAdmin are based around Smarty, with little PHP solutioning.