Menu

defining path in datamodel.xml

Shorty1
2021-12-17
2021-12-23
  • Shorty1

    Shorty1 - 2021-12-17

    Hi,
    I want to define a new logo for the user portal. Therefore I used the <logo> tag to define a new logo in the datamodel.xml. But this isn't working. I used the structure that is mentioned here: https://www.itophub.io/wiki/page?id=2_7_0%3Acustomization%3Aportal_xml</logo>

    <?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">
          <properties>
            <logo>userportal-ci/css/new-itop-logo.png</logo>
            <themes>
              <theme id="bootstrap" _delta="define_if_not_exists">userportal-ci/css/bootstrap.css</theme>
            </themes>
          </properties>
        </module_design>
      </module_designs>
    </itop_design>
    

    But it is still using the "old" one and did not redefine the logo path. Also defining the logo only with ../images/itop-logo.png doesn't work.

    Cheers Shorty

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2021-12-17

    So you created your own extension? You need to add an attribute.

    <logo _delta="redefine">userportal-ci/css/new-itop-logo.png</logo>

    You'll also need to add a dependency in the extensions module.xxx.php file to the module where itop-portal is originally defined.

     
  • Shorty1

    Shorty1 - 2021-12-20

    Hi Jeffrey,

    thanks for your answer. I'm really new to extensions, but yes I created my own, new extension. But it is hard for me to understand, therefore I need some help from your side :( How should this line looks like in the extensions.xml. I thought this file is only for specifying the name, version etc. of this extension. There is no dependency to other modules.
    I only want to define a new css (that currently work) and another logo (this doesn't work)

    module.userportal-ci.php

    <?php
    //
    // iTop module definition file
    //
    
    SetupWebPage::AddModule(
        __FILE__, // Path to the current file, all other file names are relative to the directory containing this file
        'userportal-ci/1.0.0',
        array(
            // Identification
            //
            'label' => 'CI Portal Customization',
            'category' => 'business',
    
            // Setup
            //
            'dependencies' => array(
    
            ),
            'mandatory' => false,
            'visible' => true,
    
            // Components
            //
            'datamodel' => array(
                'vendor/autoload.php',
                'model.userportal-ci.php', // Contains the PHP code generated by the "compilation" of datamodel.userportal-ci.xml
            ),
            'webservice' => array(
    
            ),
            'data.struct' => array(
                // add your 'structure' definition XML files here,
            ),
            'data.sample' => array(
                // add your sample data XML files here,
            ),
    
            // Documentation
            //
            'doc.manual_setup' => '', // hyperlink to manual setup documentation, if any
            'doc.more_information' => '', // hyperlink to more information, if any 
    
            // Default settings
            //
            'settings' => array(
                // Module specific settings go here, if any
            ),
        )
    );
    
    
    ?>
    

    Sorry to ask such dumb questions.

    Cheers Shorty

     

    Last edit: Shorty1 2021-12-20
  • Pierre Goiffon

    Pierre Goiffon - 2021-12-23

    Hello,

    Your module only needs to contains an XML file, plus the module.*.php file that is mandatory. In this later, remove everything in the datamodel key. Place your customization in a file named after your module. For example for the userportal-ci module, you should use datamodel.userportal-ci.xml.

     

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.