Forum Discussion

skylinegtr's avatar
10 years ago

Adding logo using API

Hello! I would like to add a logo next to the title of any section that is internal only (via API?) Is this possible?     We are currently using API calls for our dropdown menu    The dro...
  • VarunGrazitti's avatar
    VarunGrazitti
    10 years ago

    skylinegtr - You could may be do something like this, I haven't run the code, so please look out for any issues.

     

    <#if user.registered >
    	<#assign is_user_admin = false />
    	<#assign is_user_mod = false />
    	<#assign is_user_emp = false />
    		<#list restadmin("/users/id/${user.id?c}/roles").roles.role as role>
    			<#if role.name?? && (role.name == "Administrator")>
    				<#assign is_user_admin = true />
    				<#break />
    			<#elseif role.name?? && (role.name == "Moderator")>
    				<#assign is_user_mod = true />
    				<#break />
    			<#elseif role.name?? && (role.name == "Employee")>
    				<#assign is_user_emp = true />
    				<#break />
    			</#if>
    		</#list>
    	<#if is_user_admin >
    		This is for Admin
    	<#elseif is_user_mod >
    		This is for Mod
    	<#elseif is_user_emp >
    		This is for Emp
    	</#if>
    </#if>