I am writing a plugin that checks if you are logged in as a super admin for use in a template and returns 0 or 1. If you are logged in as a super admin it works fine, it not the web page is blank, so kind of error in my code I am assuming but I can not figure out what the problem is.
Here is my template code
{if {exp:admin:isadmin} == 1}
do something here
{/if}Here is my php code
public function isadmin()
{
return $this->EE->session->userdata('group_id') == "1";
}Any ideas? Any way to trap the error? I tried putting a try / catch in the function and return 0 but that did not make any difference. Is there a better way to check if logged in as super admin?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.