{"id":328,"date":"2019-10-04T06:22:47","date_gmt":"2019-10-04T06:22:47","guid":{"rendered":"https:\/\/docs.theironnetwork.org\/reactify\/?page_id=328"},"modified":"2019-10-10T08:28:27","modified_gmt":"2019-10-10T08:28:27","slug":"adding-menu-component-in-different-layouts-2","status":"publish","type":"page","link":"https:\/\/docs.theironnetwork.org\/reactify\/adding-menu-component-in-different-layouts-2\/","title":{"rendered":"Adding Menu\/Component In Different Layouts"},"content":{"rendered":"\n<h4>Adding a New Menu Element\/Component In SideBar Menu<\/h4>\n\n\n\n<p>You can follow the steps given below to add a new menu element in the sidebar of your template. This sidebar element is added by default in both your <strong>default<\/strong> and <strong>mini sidebar<\/strong> layout.<\/p>\n\n\n\n<p><strong>Step 1:<\/strong> Open <code>src-&gt;components-&gt;Sidebar-&gt;NavLinks.js<\/code> file. You need to add the new category items in the given code:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ sidebar nav links<br>export default {<br>   ...<br>   category6: [<br>      {<br>         \"menu_title\": \"sidebar.imageCropper\",<br>         \"menu_icon\": \"zmdi zmdi-crop\",<br>         \"path\": \"\/app\/image-cropper\",<br>         \"child_routes\": null<br>      }<br>      ...<br>   ],<br>   <br>   \/\/ Newly added category<br>   category7: [<br>      {<br>         \"menu_title\": \"sidebar.newmodules\",<br>         \"menu_icon\": \"zmdi zmdi-crop\",<br>         \"path\": \"\/app\/new-modules\",<br>         \"child_routes\": null<br>      }<br>   ]<br>}<\/pre>\n\n\n\n<p><strong>Step 2:<\/strong> Now open <code>src-&gt;lang-&gt;locales-&gt;en_US.js<\/code> file and add the newly created category under the <code>module.exports<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">module.exports = {<br>  \"sidebar.newmodules\" :\"new modules\", \/\/ Newly created category<br>  \"sidebar.app\": \"App\",<br>  ...<\/pre>\n\n\n\n<p>The example given above only add the new menu item in the english locale, if you are using any different locale for your template then you need to specify the newly created category in that locale file also. You can find different locale files under the folder <code>src-&gt;lang-&gt;locales<\/code> .<\/p>\n\n\n\n<p><strong>Step 3: <\/strong>Open<code>src-&gt;components-&gt;Sidebar-&gt;SidebarContent.js<\/code> file &amp; search for the code <code>&lt;div className=\"rct-sidebar-nav\"&gt;<\/code> and add the new list component and make the changes explained in the screenshot given below:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/add-menu-item.png\" alt=\"\" class=\"wp-image-381\" width=\"727\" height=\"460\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/add-menu-item.png 761w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/add-menu-item-300x190.png 300w\" sizes=\"(max-width: 727px) 100vw, 727px\" \/><\/figure>\n\n\n\n<p><strong>Step 4: <\/strong>Go to <code>src-&gt;routes<\/code> folder and create a folder named <code>new-modules<\/code> inside it, then create a new file named <code>index.js<\/code> inside the folder. We have created a dummy sample for you by adding the given code in the file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import React, { Component } from 'react';<br>import { Helmet } from \"react-helmet\";<br>\/\/ page title bar<br>import PageTitleBar from 'Components\/PageTitleBar\/PageTitleBar';<br> <br>\/\/ intl messages<br>import IntlMessages from 'Util\/IntlMessages';<br> <br>export default class NewList extends Component {<br>   render() {<br>      return (<br>         &lt;div className=\"blank-wrapper\"&gt;<br>           &lt;Helmet&gt;<br>              &lt;title&gt;name page&lt;\/title&gt;<br>              &lt;meta name=\"description\" content=\"Reactify Blank Page\" \/&gt;<br>           &lt;\/Helmet&gt;<br>          &lt;PageTitleBar title={&lt;IntlMessages id=\"sidebar.newmodules\" \/&gt;} match={this.props.match} \/&gt;<br>        &lt;\/div&gt;<br>      );<br>   }<br>}<\/pre>\n\n\n\n<p><strong>Step 5. <\/strong>Go to <code>src-&gt;components-&gt;AsyncComponent-&gt;AsyncComponent.js<\/code> file and create the component<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> const AsyncNewModulesComponent = Loadable({<br>      loader: () =&gt; import(\"Routes\/new-modules\"),<br>      loading: () =&gt; &lt;RctPageLoader \/&gt;,<br>});<br> <br>export {<br>     AsyncEcommerceDashboardComponent,<br>     AsyncSaasDashboardComponent,<br>     ...<br>     AsyncNewModulesComponent \/\/ export new component <br>};<\/pre>\n\n\n\n<p><strong>Step 6:<\/strong> Open the file <code>src-&gt;routes-&gt;_routerService.js<\/code> file and add the component like below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">export default [<br>   ...<br>   \/\/ Added component<br>   {<br>      path: 'new-modules',<br>      component: NewList<br>   }<br>]<br><\/pre>\n\n\n\n<p>Now you have to import the given component like:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import NewList from 'Routes\/new-modules';<\/pre>\n\n\n\n<p>After following the steps explained above, open the browser window and you can see your newly added menu item in the template. Refer the example image below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"1024\" height=\"497\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/new-modules-add-1024x497.png\" alt=\"\" class=\"wp-image-383\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/new-modules-add-1024x497.png 1024w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/new-modules-add-300x146.png 300w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/new-modules-add-768x373.png 768w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/new-modules-add.png 1306w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Template with Newly Added Menu<br><br><br><\/figcaption><\/figure>\n\n\n\n<h4>Adding a New Menu Element\/Component In Horizontal Layout<\/h4>\n\n\n\n<p>You can follow the steps given below to add a new menu element in the horizontal layout.<\/p>\n\n\n\n<p><strong>Step 1:<\/strong> Open <code>src-&gt;components-&gt;HorizontalMenu-&gt;NavLinks.js<\/code> file. You need to add the new category items in the given code:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ horizontal menu nav links<br>export default {<br>   ...<br>   category6: [<br>      {<br>         \"menu_title\": \"sidebar.imageCropper\",<br>         \"menu_icon\": \"zmdi zmdi-crop\",<br>         \"path\": \"\/horizontal\/image-cropper\",<br>         \"child_routes\": null<br>      }<br>      ...<br>   ],<br>   <br>   \/\/ Newly added category<br>   category7: [<br>      {<br>         \"menu_title\": \"sidebar.newmodules\",<br>         \"menu_icon\": \"zmdi zmdi-crop\",<br>         \"path\": \"\/horizontal\/new-modules\",<br>         \"child_routes\": null<br>      }<br>   ]<br>}<br>\u200c<br><\/pre>\n\n\n\n<p><strong>Step 2:<\/strong> You can follow the <strong>Step 2 only<\/strong> from the above described section <a href=\"https:\/\/docs.theironnetwork.org\/reactify\/adding-menu-component-in-different-layouts-2\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Adding a new menu element\/component in Sidebar Menu<\/a> as both can share the same procedure.\u200c<\/p>\n\n\n\n<p><strong>Step 3: <\/strong>Open<code>src-&gt;components-&gt;HorizontalMenu-&gt;HorizontalMenu.js<\/code> file &amp; search for the class  <code>\"horizontal-menu\"<\/code> and add the new list component and make the changes explained in the screenshot given below:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/new-list-added.png\" alt=\"\" class=\"wp-image-385\" width=\"635\" height=\"477\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/new-list-added.png 646w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/new-list-added-300x225.png 300w\" sizes=\"(max-width: 635px) 100vw, 635px\" \/><figcaption>Newly Added List<\/figcaption><\/figure>\n\n\n\n<p><strong>Step 4: <\/strong>You can follow the <strong>Step 4, 5 &amp; 6<\/strong> from the above described section <a href=\"https:\/\/docs.theironnetwork.org\/reactify\/adding-menu-component-in-different-layouts-2\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Adding a new menu element\/component in Sidebar Menu<\/a> as both can share the same procedure.\u200c<\/p>\n\n\n\n<p>After following the steps explained above, open the browser window and you can see your newly added menu item in the template. Refer the example image below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"1024\" height=\"493\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/new-module-list-1024x493.png\" alt=\"\" class=\"wp-image-386\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/new-module-list-1024x493.png 1024w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/new-module-list-300x144.png 300w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/new-module-list-768x370.png 768w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/new-module-list.png 1308w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Template with Newly Added Menu<br><br><br><\/figcaption><\/figure>\n\n\n\n<h4>Adding a New Menu Element\/Component In Agency Layout<br><\/h4>\n\n\n\n<p>You can follow the steps given below to add a new menu element in the agency layout.\u200c<\/p>\n\n\n\n<p><strong>Step 1: <\/strong>Open <code>src-&gt;components-&gt;AgencyMenu-&gt;NavLinks.js<\/code> file. You need to add the new category items in the given code:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ agency horizontal menu nav links<br>export default {<br>   ...<br>   category6: [<br>      {<br>         \"menu_title\": \"sidebar.imageCropper\",<br>         \"menu_icon\": \"zmdi zmdi-crop\",<br>         \"path\": \"\/image-cropper\",<br>         \"child_routes\": null<br>      }<br>      ...<br>   ],<br>   <br>   \/\/ Newly added category<br>   category7: [<br>      {<br>         \"menu_title\": \"sidebar.newmodules\",<br>         \"menu_icon\": \"zmdi zmdi-crop\",<br>         \"path\": \"\/new-modules\",<br>         \"child_routes\": null<br>      }<br>   ]<br>}<\/pre>\n\n\n\n<p><strong>Step 2:<\/strong> You can follow the <strong>Step 2 only<\/strong> from the above described section <a href=\"https:\/\/docs.theironnetwork.org\/reactify\/adding-menu-component-in-different-layouts-2\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Adding a new menu element\/component in Sidebar Menu<\/a> as both can share the same procedure.\u200c<\/p>\n\n\n\n<p><strong>Step 3: <\/strong>Open<code>src-&gt;components-&gt;AgencyMenu-&gt;AgencyMenu.js<\/code> file &amp; search for the class  <code>\"agency-menu\"<\/code> and add the new list component and make the changes explained in the screenshot given below:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/add-agency-modules.png\" alt=\"\" class=\"wp-image-387\" width=\"697\" height=\"451\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/add-agency-modules.png 744w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/add-agency-modules-300x194.png 300w\" sizes=\"(max-width: 697px) 100vw, 697px\" \/><figcaption>Newly Added List<\/figcaption><\/figure>\n\n\n\n<p><strong>Step 4: <\/strong>You can follow the <strong>Step 4, 5 &amp; 6<\/strong> from the above described section <a href=\"https:\/\/docs.theironnetwork.org\/reactify\/adding-menu-component-in-different-layouts-2\/\">Adding a new menu element\/component in Sidebar Menu<\/a> as both can share the same procedure.\u200c<\/p>\n\n\n\n<p>After following the steps explained above, open the browser window and you can see your newly added menu item in the template. Refer the example image below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"1024\" height=\"492\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/agency-module-add-1024x492.png\" alt=\"\" class=\"wp-image-388\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/agency-module-add-1024x492.png 1024w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/agency-module-add-300x144.png 300w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/agency-module-add-768x369.png 768w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/agency-module-add.png 1311w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Template with Newly Added Menu<\/figcaption><\/figure>\n\n\n\n<p><br><\/p>\n<div class=\"pld-like-dislike-wrap pld-template-1\">\n    <div class=\"pld-like-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-like-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"328\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-ip-check=\"0\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-up\"><\/i>\n                    <\/a>\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-dislike-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"328\" data-trigger-type=\"dislike\" data-ip-check=\"0\" data-restriction=\"cookie\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-down\"><\/i>\n                    <\/a>\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\n<\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Adding a New Menu Element\/Component In SideBar Menu You can follow the steps given below to add a new menu element in the sidebar of your template. This sidebar element is added by default in both your default and mini sidebar layout. Step 1: Open src-&gt;components-&gt;Sidebar-&gt;NavLinks.js file. You need to add the new category items [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/328"}],"collection":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/comments?post=328"}],"version-history":[{"count":13,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/328\/revisions"}],"predecessor-version":[{"id":647,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/328\/revisions\/647"}],"wp:attachment":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/media?parent=328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}