UdaySagar
UdaySagar

Reputation: 83

sugarcrm - Opening an action item of menu in new tab

I am new to Sugar CRM. I have a new item named "Maps" which is in actions under Leads menu. I found for "Maps" in the whole project and found it in menu.ext.php. Here it is assigned to an array variable as a parameter as show below

$module_menu[]=Array(
        "http://mydomain/myProject/maps/something.php" ,
        "Maps","Leads");

I need to add target="_blank" to the anchor tag of this "Maps" action item so that it opens in a new tab.

Upvotes: 0

Views: 755

Answers (1)

UdaySagar
UdaySagar

Reputation: 83

I have implemented the feature using the following code:

mysugarcrmDomain\custom\themes\Sugar5\tpls\_headerShortcuts.tpl

I have written if-else logic as shown below for the action items

{else}
    {foreach from=$SHORTCUT_MENU item=item}
          {if $item.LABEL == "Maps"}
            <span style="white-space:nowrap;">
           <a target="_blank" href="{$item.URL}">{$item.IMAGE}&nbsp;<span>{$item.LABEL}</span></a>
       </span>
          {else}
       <span style="white-space:nowrap;">
           <a href="{$item.URL}">{$item.IMAGE}&nbsp;<span>{$item.LABEL}</span></a>
       </span>
          {/if}
    {/foreach}
{/if}

Hope it helps someone in need.

Upvotes: 1

Related Questions