Menu

How to add navigation menu

Jedi Star
2022-05-22
2022-05-26
  • Jedi Star

    Jedi Star - 2022-05-22

    Hello Everyone!

    I want to add a new navigation menu and some links at backoffice page. Please explain in detail in order what needs to be done, what needs to be created and where to write the code. I am a new at iTop. Thanks

    Best regards.

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2022-05-22

    You would need to create an iTop extension to add these new menu items to the XML datamodel.

    There's some really good documentation by Combodo. And some official examples; but there's a lot more in this repository too on how to accomplish certain things.

    Most useful resources are these, where you'll also find how to add those menu items/links:

    https://www.itophub.io/wiki/page?id=latest%3Acustomization%3Axml_reference
    https://www.itophub.io/wiki/page?id=latest%3Acustomization%3Adatamodel#content_of_a_module
    
     
  • Riccardo Falzea

    Riccardo Falzea - 2022-05-25

    Hi everyone,
    i am trying to implement a similar menu. I created my brick with embedded webpage:

    <?xml version="1.0" encoding="UTF-8"?>
    <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3">
        <module_designs>
            <module_design id="itop-portal" xsi:type="portal">
            <bricks>
                    <!-- Exemple for a UrlBrick -->
                    <brick id="url-to-combodo-website" xsi:type="Combodo\iTop\Portal\Brick\UrlBrick" _delta="define">
                        <rank>
                            <default>120</default>
                        </rank>
                        <width>6</width>
                        <title>
                            <default>wikipedia</default>
                        </title>
                        <description>
                            <![CDATA[ <p>Combodo website</p> ]]>
                        </description>
                        <decoration_class>
                            <default>fa fa-globe fa-2x</default>
                        </decoration_class>
                        <!-- Text or dictionary entry to be displayed uneder the brick title -->
                        <!--<subtitle/>-->
                        <!-- URL of the webpage to display. Note: Omitting the "http:" will make the iframe automatically use the same protocol "http|https" as the parent web page. This is mostly necessary when the server is forced to https. -->
                        <url>//it.wikipedia.org/wiki/Pagina_principale</url>
                        <!-- FQN of a static method (without parenthesis) that returns an array of extra parameters (param => value) to add to the URL. -->
                        <!-- Returned parameters will be url-encoded automatically. -->
                        <!-- Note: Extra code can be done there like setting cookies or so. -->
                        <!--<url_parameters_callback><![CDATA[\Ticket::FooMethod]]></url_parameters_callback>-->
                        <!-- Fullscreen true|false. Defines if the webpage is displayed with its title and subtitle or fills all the page. Default is false. -->
                        <!--<fullscreen>false</fullscreen>-->
                        <fullscreen> true </fullscreen>
                    </brick>
                </bricks>
            </module_design>
        </module_designs>
    </itop_design>
    

    However it is not clear to me how to display it in the left bar. Can you provide any clarifications? Thanks

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2022-05-25

    What have you put together so far?

    You need to create an extension, which contains a file similar to "datamodel.yourextension.xml".
    In that file, you put the code - the above being an example, adjust it to your needs.

    Put the extension in iTop's "extensions" folder and re-run t he setup.

     
  • Riccardo Falzea

    Riccardo Falzea - 2022-05-25

    that's exactly what I did.
    I downloaded this tutorial extension:
    https://www.itophub.io/wiki/page?id=extensions%3Aitop-portal-url-brick for itop 2.7.6.
    I installed this extension by modifying the datamodel as shown (I just want to show the wikipedia page) and with the toolkit I performed the update, however a new item does not appear in the menu and I do not understand what is causing the problem.

     

    Last edit: Riccardo Falzea 2022-05-25
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2022-05-25

    Perhaps upload the ZIP file you created and share it somewhere.

     
  • Riccardo Falzea

    Riccardo Falzea - 2022-05-26

    here is my extension, thanks for your patience and support.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.