<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://sugarclub.sugarcrm.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav</link><pubDate>Wed, 12 Oct 2022 15:00:28 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Current Revision posted to Dev Tutorials by Scott King on 10/12/2022 3:00:28 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new&amp;nbsp;&lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that extends &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the two&amp;nbsp;primary files that make up your view. By default, we can use the out of the box template for our view.&amp;nbsp;&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
      &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM sidebar nav item example" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-14/Group-1.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;secondary_action&amp;#39; =&amp;gt; true,
        &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM with sidebar nav item with secondary action" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-14/Group-2.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Customizing the sidebar-nav-item Template&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By default, our new &lt;code&gt;sidebar-nav-item&lt;/code&gt; is using the base Handlebars template. If you&amp;#39;d like to customize the template, create the following file:&amp;nbsp;&lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;&lt;/span&gt;. The following snippet is the template for the base view for reference.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
    
    {{#if secondaryAction}}
        &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/button&amp;gt;
    {{/if}}
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Next, in&amp;nbsp;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php remove the &lt;code&gt;&amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;&lt;/code&gt; metadata entry.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ 
            &amp;#39;layout&amp;#39; =&amp;gt; &amp;#39;...&amp;#39;,
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/36</link><pubDate>Thu, 29 Sep 2022 18:18:36 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 36 posted to Dev Tutorials by Scott King on 9/29/2022 6:18:36 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that extends &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the two&amp;nbsp;primary files that make up your view. By default, we can use the out of the box template for our view.&amp;nbsp;&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
      &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM sidebar nav item example" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-1.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;secondary_action&amp;#39; =&amp;gt; true,
        &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM with sidebar nav item with secondary action" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-2.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Customizing the sidebar-nav-item Template&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By default, our new &lt;code&gt;sidebar-nav-item&lt;/code&gt; is using the base Handlebars template. If you&amp;#39;d like to customize the template, create the following file:&amp;nbsp;&lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;&lt;/span&gt;. The following snippet is the template for the base view for reference.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
    
    {{#if secondaryAction}}
        &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/button&amp;gt;
    {{/if}}
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Next, in&amp;nbsp;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php remove the &lt;code&gt;&amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;&lt;/code&gt; metadata entry.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ 
            &amp;#39;layout&amp;#39; =&amp;gt; &amp;#39;...&amp;#39;,
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/37</link><pubDate>Thu, 29 Sep 2022 18:18:36 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 37 posted to Dev Tutorials by Scott King on 9/29/2022 6:18:36 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that extends &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the two&amp;nbsp;primary files that make up your view. By default, we can use the out of the box template for our view.&amp;nbsp;&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
      &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM sidebar nav item example" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-14/Group-1.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;secondary_action&amp;#39; =&amp;gt; true,
        &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM with sidebar nav item with secondary action" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-14/Group-2.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Customizing the sidebar-nav-item Template&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By default, our new &lt;code&gt;sidebar-nav-item&lt;/code&gt; is using the base Handlebars template. If you&amp;#39;d like to customize the template, create the following file:&amp;nbsp;&lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;&lt;/span&gt;. The following snippet is the template for the base view for reference.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
    
    {{#if secondaryAction}}
        &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/button&amp;gt;
    {{/if}}
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Next, in&amp;nbsp;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php remove the &lt;code&gt;&amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;&lt;/code&gt; metadata entry.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ 
            &amp;#39;layout&amp;#39; =&amp;gt; &amp;#39;...&amp;#39;,
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/35</link><pubDate>Thu, 29 Sep 2022 16:25:29 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 35 posted to Dev Tutorials by Scott King on 9/29/2022 4:25:29 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that extends &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the two&amp;nbsp;primary files that make up your view. By default, we can use the out of the box template for our view.&amp;nbsp;&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
      &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM sidebar nav item example" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-1.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;secondary_action&amp;#39; =&amp;gt; true,
        &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM with sidebar nav item with secondary action" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-2.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Customizing the sidebar-nav-item Template&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By default, our new &lt;code&gt;sidebar-nav-item&lt;/code&gt; is using the base Handlebars template. If you&amp;#39;d like to customize the template, create the following file:&amp;nbsp;&lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;&lt;/span&gt;. The following snippet is the template for the base view for reference.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
    
    {{#if secondaryAction}}
        &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/button&amp;gt;
    {{/if}}
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Next, in&amp;nbsp;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php remove the &lt;code&gt;&amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;&lt;/code&gt; metadata entry.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ 
            &amp;#39;layout&amp;#39; =&amp;gt; &amp;#39;...&amp;#39;,
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/34</link><pubDate>Thu, 29 Sep 2022 16:14:06 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 34 posted to Dev Tutorials by Scott King on 9/29/2022 4:14:06 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that extends &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the two&amp;nbsp;primary files that make up your view. By default, we can use the out of the box template for our view.&amp;nbsp;&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
      &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM sidebar nav item example" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-1.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;secondary_action&amp;#39; =&amp;gt; true,
        &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM with sidebar nav item with secondary action" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-2.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Customizing the sidebar-nav-item Template&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By default, our new &lt;code&gt;sidebar-nav-item&lt;/code&gt; is using the base Handlebars template. If you&amp;#39;d like to customize the template, create the following file:&amp;nbsp;&lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;&lt;/span&gt;. The following snippet is the template for the base view for reference.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
    
    {{#if secondaryAction}}
        &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/button&amp;gt;
    {{/if}}
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Next, in&amp;nbsp;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php remove the &lt;code&gt;&amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;&lt;/code&gt; metadata entry.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/33</link><pubDate>Thu, 29 Sep 2022 16:11:48 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 33 posted to Dev Tutorials by Scott King on 9/29/2022 4:11:48 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that extends &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the two&amp;nbsp;primary files that make up your view. By default, we can use the out of the box template for our view.&amp;nbsp;&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
      &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM sidebar nav item example" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-1.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM with sidebar nav item with secondary action" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-2.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Customizing the sidebar-nav-item Template&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By default, our new &lt;code&gt;sidebar-nav-item&lt;/code&gt; is using the base Handlebars template. If you&amp;#39;d like to customize the template, create the following file:&amp;nbsp;&lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;&lt;/span&gt;. The following snippet is the template for the base view for reference.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
    
    {{#if secondaryAction}}
        &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/button&amp;gt;
    {{/if}}
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Next, in&amp;nbsp;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php remove the &lt;code&gt;&amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;&lt;/code&gt; metadata entry.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/32</link><pubDate>Thu, 29 Sep 2022 16:10:46 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 32 posted to Dev Tutorials by Scott King on 9/29/2022 4:10:46 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that extends &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the two&amp;nbsp;primary files that make up your view. By default, we can use the out of the box template for our view.&amp;nbsp;&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
      &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM sidebar nav item example" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-1.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Customizing the Nav Item Template&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;By default, our new &lt;code&gt;sidebar-nav-item&lt;/code&gt; is using the base Handlebars template. If you&amp;#39;d like to customize the template, create the following file:&amp;nbsp;&lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;&lt;/span&gt;. The following snippet is the template for the base view for reference.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
    
    {{#if secondaryAction}}
        &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/button&amp;gt;
    {{/if}}
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;Next, in&amp;nbsp;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php remove the &lt;code&gt;&amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;&lt;/code&gt; metadata entry.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM with sidebar nav item with secondary action" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-2.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/31</link><pubDate>Thu, 29 Sep 2022 15:53:01 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 31 posted to Dev Tutorials by Scott King on 9/29/2022 3:53:01 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that extends &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the two&amp;nbsp;primary files that make up your view. By default, we can use the out of the box template for our view.&amp;nbsp;&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
      &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM sidebar nav item example" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-1.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Customizing the Nav Item Template&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;By default, our sidebar-nav-item is using the template from the base view. If you&amp;#39;d like to customize the template, create the following file:&amp;nbsp;&lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;&lt;/span&gt;. The following snippet is the template for the base view for reference.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
    
    {{#if secondaryAction}}
        &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/button&amp;gt;
    {{/if}}
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM with sidebar nav item with secondary action" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-2.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/30</link><pubDate>Thu, 29 Sep 2022 15:50:03 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 30 posted to Dev Tutorials by Scott King on 9/29/2022 3:50:03 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that extends &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the three primary files that make up your view:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
      &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM sidebar nav item example" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-1.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Customizing the Nav Item Template&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM with sidebar nav item with secondary action" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-2.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/29</link><pubDate>Thu, 29 Sep 2022 15:48:50 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 29 posted to Dev Tutorials by Scott King on 9/29/2022 3:48:50 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that extends &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the three primary files that make up your view:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
      &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM sidebar nav item example" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-1.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Customizing the Nav Item Template&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM with sidebar nav item with secondary action" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-2.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/28</link><pubDate>Thu, 29 Sep 2022 15:48:29 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 28 posted to Dev Tutorials by Scott King on 9/29/2022 3:48:29 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that extends &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the three primary files that make up your view:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
      &amp;#39;template&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM sidebar nav item example" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-1.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Customizing the Nav Item Template&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM with sidebar nav item with secondary action" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-2.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/27</link><pubDate>Thu, 29 Sep 2022 14:54:16 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 27 posted to Dev Tutorials by Scott King on 9/29/2022 2:54:16 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that will contain your button and logic. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the three primary files that make up your view:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.hbs&lt;/code&gt; - Contains the handlebar template for your view&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs:&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM sidebar nav item example" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-1.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM with sidebar nav item with secondary action" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-2.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/26</link><pubDate>Thu, 29 Sep 2022 13:24:36 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 26 posted to Dev Tutorials by Scott King on 9/29/2022 1:24:36 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that will contain your button and logic. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the three primary files that make up your view:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.hbs&lt;/code&gt; - Contains the handlebar template for your view&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs:&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM sidebar nav item example" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-1.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM with sidebar nav item with secondary action" src="/resized-image/__size/1280x838/__key/communityserver-wikis-components-files/00-00-00-00-61/Group-2.jpg" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/25</link><pubDate>Thu, 29 Sep 2022 13:21:59 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 25 posted to Dev Tutorials by Scott King on 9/29/2022 1:21:59 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that will contain your button and logic. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the three primary files that make up your view:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.hbs&lt;/code&gt; - Contains the handlebar template for your view&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs:&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM sidebar nav item example" src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-61/image1.png" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;img alt="SugarCRM with sidebar nav item with secondary action" src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-61/image2.png" /&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/24</link><pubDate>Wed, 28 Sep 2022 20:27:31 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 24 posted to Dev Tutorials by Scott King on 9/28/2022 8:27:31 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that will contain your button and logic. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the three primary files that make up your view:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.hbs&lt;/code&gt; - Contains the handlebar template for your view&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs:&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;view&amp;#39; =&amp;gt; [
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
        &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
            ],
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                    &amp;#39;actions&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/23</link><pubDate>Wed, 28 Sep 2022 19:48:34 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 23 posted to Dev Tutorials by Scott King on 9/28/2022 7:48:34 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that will contain your button and logic. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the three primary files that make up your view:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.hbs&lt;/code&gt; - Contains the handlebar template for your view&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs:&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;layout&amp;#39; =&amp;gt; [
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
        &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
        &amp;#39;components&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
                    &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                    &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
                    &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                            &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
                        ],
                        [
                            &amp;#39;view&amp;#39; =&amp;gt; [
                                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                &amp;#39;actions&amp;#39; =&amp;gt; [
                                    [
                                        &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/22</link><pubDate>Wed, 28 Sep 2022 19:39:08 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 22 posted to Dev Tutorials by Scott King on 9/28/2022 7:39:08 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that will contain your button and logic. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the three primary files that make up your view:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.hbs&lt;/code&gt; - Contains the handlebar template for your view&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs:&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;layout&amp;#39; =&amp;gt; [
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
        &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
        &amp;#39;components&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                    &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                    &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
                    &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                            &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
                        ],
                        [
                            &amp;#39;view&amp;#39; =&amp;gt; [
                                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                &amp;#39;actions&amp;#39; =&amp;gt; [
                                    [
                                        &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/21</link><pubDate>Wed, 28 Sep 2022 19:37:01 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 21 posted to Dev Tutorials by Scott King on 9/28/2022 7:37:01 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that will contain your button and logic. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the three primary files that make up your view:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.hbs&lt;/code&gt; - Contains the handlebar template for your view&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs:&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;layout&amp;#39; =&amp;gt; [
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
        &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
        &amp;#39;components&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                    &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                    &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
                    &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                            &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
                        ],
                        [
                            &amp;#39;view&amp;#39; =&amp;gt; [
                                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                &amp;#39;actions&amp;#39; =&amp;gt; [
                                    [
                                        &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/20</link><pubDate>Wed, 28 Sep 2022 19:31:41 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 20 posted to Dev Tutorials by Scott King on 9/28/2022 7:31:41 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that will contain your button and logic. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the three primary files that make up your view:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.hbs&lt;/code&gt; - Contains the handlebar template for your view&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs:&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;layout&amp;#39; =&amp;gt; [
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
        &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
        &amp;#39;components&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                    &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                    &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
                    &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                            &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
                        ],
                        [
                            &amp;#39;view&amp;#39; =&amp;gt; [
                                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                &amp;#39;actions&amp;#39; =&amp;gt; [
                                    [
                                        &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;greeting-nav-item&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/19</link><pubDate>Tue, 27 Sep 2022 15:35:06 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 19 posted to Dev Tutorials by Scott King on 9/27/2022 3:35:06 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that will contain your button and logic. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the three primary files that make up your view:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.hbs&lt;/code&gt; - Contains the handlebar template for your view&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs:&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;layout&amp;#39; =&amp;gt; [
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
        &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
        &amp;#39;components&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                    &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                    &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
                    &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                            &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
                        ],
                        [
                            &amp;#39;view&amp;#39; =&amp;gt; [
                                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                &amp;#39;actions&amp;#39; =&amp;gt; [
                                    [
                                        &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        [ ... ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Moving Footer content to Sidebar Nav</title><link>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav/revision/18</link><pubDate>Tue, 27 Sep 2022 15:34:42 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:da78714d-ee5e-4703-bb22-c0031e2d6e1d</guid><dc:creator>Scott King</dc:creator><comments>https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/742/moving-footer-content-to-sidebar-nav#comments</comments><description>Revision 18 posted to Dev Tutorials by Scott King on 9/27/2022 3:34:42 PM&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This example explains how to&amp;nbsp;add&amp;nbsp;additional buttons to a new section in the sidebar nav layout. You may have previously customized a button that was added to the &lt;code&gt;footer&lt;/code&gt; layout, which can be repurposed here and&amp;nbsp;added to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout. We will create a custom view&amp;nbsp;and append the view component to the &lt;code&gt;sidebar-nav&lt;/code&gt; layout metadata. The additional button will merely show an alert and a flyout menu with a link to the Accounts module but can be expanded to do much more.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Steps To Complete&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;This tutorial requires the following steps, which are explained in the sections below:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;Extend the language files to include the new labels&lt;/li&gt;
&lt;li&gt;Creating the Custom View&lt;/li&gt;
&lt;li&gt;Appending the View to Layout Metadata&lt;/li&gt;
&lt;li&gt;Adding a Secondary Action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Extending the Language files to Include New Labels&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll want to add a couple new labels for our new &lt;code&gt;sidebar-nav-item&lt;/code&gt;. To do, create the following file:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/Language/en_us.greetingNavItem.php&lt;/code&gt;. Now add the following contents to the file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Hello&amp;quot; label
$app_strings[&amp;#39;LBL_HELLO_C&amp;#39;] = &amp;#39;Hello!&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Creating the Custom View with a Primary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;To add a new &lt;code&gt;sidebar-nav-item-group&lt;/code&gt; and &lt;code&gt;sidebar-nav-item&lt;/code&gt;, you will first need to create the custom view that will contain your button and logic. To create the custom view create a folder&amp;nbsp;in .&lt;code&gt;/custom/clients/base/views&lt;/code&gt;&amp;nbsp;with the name of your view, such as&amp;nbsp;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/&lt;/code&gt;. Once your folder is in place, you can create the three primary files that make up your view:&lt;/p&gt;
&lt;ol style="font-weight:400;"&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.hbs&lt;/code&gt; - Contains the handlebar template for your view&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.js&lt;/code&gt; - Contains the JavaScript controller logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;greeting-nav-item.php&lt;/code&gt; - Contains the metadata your view might use. For this example, we simply use the metadata to define whether the greeting will auto close or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs:&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{!
    Define HTML for our new button.  We will mimic the style of other buttons
    in the sidebar-nav so we remain consistent.
}}
{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note&lt;/strong&gt;: Sidebar components must be expanded/collapsed state aware now, therefore you must make sure to provide&amp;nbsp;&lt;code&gt;collapsed&lt;/code&gt; (simple icon) and &lt;code&gt;expanded&lt;/code&gt; (icon + text)&amp;nbsp;class elements in your buttons.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.js&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;({
    extendsFrom: &amp;#39;SidebarNavItemView&amp;#39;,

    primaryActionOnClick: function() {
        app.alert.show(&amp;#39;greeting-alert&amp;#39;, {
            level: &amp;#39;info&amp;#39;,
            messages: &amp;#39;Hello &amp;#39;+ app.user.get(&amp;#39;full_name&amp;#39;) + &amp;#39;!&amp;#39;,
            autoClose: this.meta.autoClose || false
        });
    },
})&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;view&amp;#39;][&amp;#39;greeting-nav-item&amp;#39;] = array(
    &amp;#39;autoClose&amp;#39; =&amp;gt; true
);&lt;/pre&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Appending the View to Layout Metadata&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once the view is created, you simply need to add the view to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout metadata. The sidebar-nav Layout is located in&amp;nbsp;&lt;code&gt;./clients/base/layouts/sidebar-nav/&lt;/code&gt;, so appending the view to this layout can be done via the Extension Framework. Create a file in&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/&lt;/code&gt;&amp;nbsp;and the Extension Framework will append the metadata to the &lt;code&gt;sidebar-nav&lt;/code&gt; Layout.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Next, we&amp;rsquo;ll want to create the view:&amp;nbsp;&lt;code&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php 

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
  &amp;#39;view&amp;#39; =&amp;gt; [
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
      &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
      &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
   ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once all the files are in place, you can run a Quick Repair and Rebuild and a new group and &lt;code&gt;sidebar-nav-item&lt;/code&gt; in the bottom of the &lt;code&gt;sidebar-nav&lt;/code&gt; bar layout.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Adding a Secondary Action&lt;/strong&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;With the introduction of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; component, we&amp;rsquo;re now introducing Secondary Actions. These appear by way of a kebab menu when hovering on the &lt;code&gt;sidebar-nav-item&lt;/code&gt; container to which they are added. It can be configured similar to a Primary Action.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;In this example, we&amp;rsquo;ll add a secondary action to our &lt;code&gt;greeting-nav-item&lt;/code&gt; view. It will trigger a flyout menu that has a link to the Accounts module.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;First, let&amp;#39;s add a new label to the language file we created earlier for our flyout menu header:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

// Create the &amp;quot;Greetings&amp;quot; header 
$app_strings[&amp;#39;LBL_GREETINGS_C&amp;#39;] = &amp;#39;Greetings&amp;#39;;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Second, we&amp;#39;ll need to add the markup to render the kebab icon in &lt;span&gt;&lt;code&gt;./custom/clients/base/views/greeting-nav-item/greeting-nav-item.hbs&lt;/code&gt;. The new template will look as such:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="html"&gt;{{#if appIsSynced}}
    &amp;lt;button class=&amp;quot;sidebar-nav-item-btn w-full bg-transparent absolute p-0 text-base text-initial&amp;quot;
       rel=&amp;quot;tooltip&amp;quot;
       data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot;
       title=&amp;quot;{{str label module}}&amp;quot;
    &amp;gt;
        &amp;lt;span class=&amp;quot;collapsed block ml-0 px-5.5 py-2&amp;quot; rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
        &amp;lt;span class=&amp;quot;expanded ellipsis_inline ml-0 px-5.5 py-2 text-white&amp;quot;  rel=&amp;quot;tooltip&amp;quot; data-placement=&amp;quot;{{tooltipPlacement}}&amp;quot; title=&amp;quot;{{str label module}}&amp;quot;&amp;gt;
            &amp;lt;i class=&amp;quot;{{buildIcon icon}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
            &amp;lt;span class=&amp;quot;text-sm pl-4.5&amp;quot;&amp;gt;{{str label module}}&amp;lt;/span&amp;gt;
        &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;

    &amp;lt;button class=&amp;quot;sidebar-nav-item-kebab bg-transparent absolute p-0 h-full&amp;quot;&amp;gt;
       &amp;lt;i class=&amp;quot;{{buildIcon &amp;#39;sicon-kebab&amp;#39;}} text-white&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;/button&amp;gt;
{{/if}}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Now we can define the components that will be used in the flyout menus via metadata in&amp;nbsp;&lt;span&gt;./custom/Extension/application/Ext/clients/base/layouts/sidebar-nav/greeting-nav-item.php. The new metadata looks like this:&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;][&amp;#39;components&amp;#39;][] = [
    &amp;#39;layout&amp;#39; =&amp;gt; [
        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
        &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
        &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
        &amp;#39;components&amp;#39; =&amp;gt; [
            [
                &amp;#39;view&amp;#39; =&amp;gt; [
                    &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                    &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                    &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                    &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_HELLO_C&amp;#39;,
                    &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                        [
                            &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                            &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;LBL_GREETINGS_C&amp;#39;,
                        ],
                        [
                            &amp;#39;view&amp;#39; =&amp;gt; [
                                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                &amp;#39;actions&amp;#39; =&amp;gt; [
                                    [
                                        &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                        &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                        &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Once these changes are added, you can&amp;nbsp;run a Quick Repair and Rebuild and sidebar-nav-item will be updated with a Secondary Action.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;You may need to refresh the page to see the profile menu items removed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;Changing position of sidebar-nav-item&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;&lt;/strong&gt;If you need to change the position of the &lt;code&gt;sidebar-nav-item&lt;/code&gt; in&amp;nbsp;the &lt;code&gt;sidebar-nav&lt;/code&gt; layout, it is recommended that the layout be redefined using custom metadata. For example, if you&amp;nbsp;wanted to move the group we created above, we could define the custom metadata as such:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;code&gt;./custom/clients/base/layouts/sidebar-nav/sidebar-nav.php&lt;/code&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php

/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs[&amp;#39;base&amp;#39;][&amp;#39;layout&amp;#39;][&amp;#39;sidebar-nav&amp;#39;] = [
    &amp;#39;components&amp;#39; =&amp;gt; [
        ...
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-modules&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow flex-shrink&amp;#39;,
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [
                    [
                        &amp;#39;view&amp;#39; =&amp;gt; [
                            &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;footer-greet-button&amp;#39;,
                            &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                            &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-bell-lg&amp;#39;,
                            &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;Hello!&amp;#39;,
                            &amp;#39;flyoutComponents&amp;#39; =&amp;gt; [
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-header&amp;#39;,
                                    &amp;#39;title&amp;#39; =&amp;gt; &amp;#39;Greetings&amp;#39;,
                                ],
                                [
                                    &amp;#39;view&amp;#39; =&amp;gt; [
                                        &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-flyout-actions&amp;#39;,
                                        &amp;#39;actions&amp;#39; =&amp;gt; [
                                            [
                                                &amp;#39;route&amp;#39; =&amp;gt; &amp;#39;#Accounts&amp;#39;,
                                                &amp;#39;label&amp;#39; =&amp;gt; &amp;#39;LBL_ACCOUNTS&amp;#39;,
                                                &amp;#39;icon&amp;#39; =&amp;gt; &amp;#39;sicon-account-lg&amp;#39;,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        [
            &amp;#39;layout&amp;#39; =&amp;gt; [
                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group&amp;#39;,
                &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;sidebar-nav-item-group-bottom&amp;#39;,
                &amp;#39;css_class&amp;#39; =&amp;gt; &amp;#39;flex-grow-0 flex-shrink-0&amp;#39;,
                &amp;#39;components&amp;#39; =&amp;gt; [ ... ],
            ],
        ],
    ],
];&lt;/pre&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this is a best practice for customizing base metadata, these base layouts are subject to change and may be changed in the future. Maintenance of these customizations belongs to the owner of the instance.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item></channel></rss>