Remove API Link From page header

(CoronaPro) #1

I need to remove the API link at the top of the page, but keep the plugin itself operating.

I have been seraching through the code and have not yet found where this is generated, all i have been able to do is remove the content from the page.


(Gus) #2


You can look at this file : piwik/plugins/CoreHome/templates/top_bar.tpl

The div “topLeftBar” contains the elements you want to edit.

(CoronaPro) #3


I added an extra if statement inside the foreach to check if the name is “API”, code below

{if $element.0 != 'API' } ... {/if}



Can you help me out and post your full code from the topLeftBar section? I am trying to get rid of the API link, but my PHP skills are limited. :slight_smile:

Greatly appreciate it!

What do I need to modify in the below code?

{foreach from=$topMenu key=label item=menu name=topMenu} {if isset($menu._html)} {$menu._html} {elseif $menu._url.module == $currentModule} {$label|translate} | {else} {$label|translate} | {/if} {/foreach}


(Ko de Pree) #5

In Piwik 1.4 I removed some links (API and Widgets) in the topmenu with the following code in the file /plugins/CoreHome/templates/top_bar.tpl

<div id="topBars">

<div id="topLeftBar">
{foreach from=$topMenu key=label item=menu name=topMenu}
        {if isset($menu._html)}
        {elseif $menu._url.module == 'API'}
        {elseif $menu._url.module == 'Widgetize'}            
        {elseif $menu._url.module == $currentModule}
            <span class="topBarElem"><b>{$label|translate}</b></span> | 
            <span class="topBarElem"><a id="topmenu-{$menu._url.module|strtolower}" href="index.php{$menu._url|@urlRewriteWithParameters}">{$label|translate}</a></span> | 

<div id="topRightBar">
{capture assign=helloAlias}{if !empty($userAlias)}{$userAlias}{else}{$userLogin}{/if}{/capture}
<span class="topBarElem">{'General_HelloUser'|translate:"<strong>$helloAlias</strong>"}</span>
{if $userLogin != 'anonymous'}| <span class="topBarElem"><a href='index.php?module=CoreAdminHome'>{'General_Settings'|translate}</a></span>{/if}
| <span class="topBarElem">{if $userLogin == 'anonymous'}<a href='index.php?module={$loginModule}'>{'Login_LogIn'|translate}</a>{else}<a href='index.php?module={$loginModule}&action=logout'>{'Login_Logout'|translate}</a>{/if}</span>


{if $showSitesSelection}{include file="CoreHome/templates/sites_selection.tpl"}{/if}


How would you remove the Feedback link?

(Ko de Pree) #7

Feedback is a Plugin which you can turn off.