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 dropdown menu code looks like this:
 <#assign categories = rest("/categories").categories />
           <#list categories.category as category>
           <li><a href="${category.@view_href}">${category.title}</a>
               <ul class="menu menu-flash-array">
                    <#list rest(category.@href+"/boards").boards.board as board >
                    <li><a href="${board.@view_href}">${board.title}</a></li>
                    </#list>
                </ul>
            </li>
            </#list>
 
Thank you!
 
  • 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>