Customize Menu Options Metadata

Menuoptions metadata file is used to define the left menu items and shortcuts of the application.


What does this section cover?

Menu Options File

Custom left menu items along with their pages' URLs are declared in menuoptions.xml file which must be created under <custom_project>/web/WebContent/metadata directory.

All menu option IDs must be defined in modules.xml under <leftmenuoptions> or<settingmenuoptions>. For more information on creating modules.xml, got to Customise Modules Metadata. 

Create Custom Menu Items

In the following example, three new custom menu items will be defined.

 menuoptions.xml
menuoptions.xml
<menuoptionconfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/menuOptions.xsd">
	<menuoptions>
		<!-- Billing> Provisioning > Local SMS Provider  -->
		<menuoption>
			<id>CUSTOM_LOCAL_SMS_PROVIDER</id>
			<name>key_local_sms_provider</name>
			<description>key_local_sms_provider</description>
			<menuoptionparentid>PROVISIONING</menuoptionparentid>
			<menuoptionordernum>1</menuoptionordernum>
		</menuoption>
        <!-- Billing > Provisioning > Local SMS Provider > Manage Settings -->
		<menuoption>
			<id>CUSTOM_MANAGE_LOCAL_SMS_PROVIDER_SETTINGS</id>
			<name>key_manage_settings</name>
			<description>key_manage_settings</description>
			<menuoptionparentid>CUSTOM_LOCAL_SMS_PROVIDER</menuoptionparentid>
			<menuoptionordernum>1</menuoptionordernum>
			<menuoptionurl>page.do?xml=provisioning/localsmsprovider/settings&amp;act=itm&amp;fc=loadForm&amp;jndi=ejb/COMPANYCRMUISmsSettingsDefinition</menuoptionurl>
		</menuoption>
        <!-- Billing > Subscriptions> Import Subscriptions -->
		<menuoption>
			<id>CUSTOM_IMPORT_SUBSCRIPTIONS</id>
			<name>key_import_subscriptions</name>
			<description>key_import_subscriptions</description>
			<menuoptionparentid>SUBSCRIPTIONS</menuoptionparentid>
			<menuoptionurl>page.do?xml=subscriptions/importSubscriptions&amp;act=itm&amp;fc=importSubscription&amp;jndi=ejb/COMPANYCRMImportSubscription</menuoptionurl>
			<menuoptionordernum>9</menuoptionordernum>
		</menuoption>
		<!-- Finance Application > Price -->
		<menuoption>
			<id>CUSTOM_PRICE</id>
			<name>key_price</name>
			<description>key_price</description>
			<menuoptionparentid>FINANCE_APPLICATION</menuoptionparentid>
			<menuoptionordernum>1</menuoptionordernum>
			<menuoptionurl>price/priceSummary.xhtml</menuoptionurl>
		</menuoption>
		<!-- Finance Application > Price Limit -->
		<menuoption>
			<id>CUSTOM_PRICE_LIMIT</id>
			<name>key_price_limit</name>
			<description>key_price_limit</description>
			<menuoptionparentid>FINANCE_APPLICATION</menuoptionparentid>
			<menuoptionordernum>2</menuoptionordernum>
			<menuoptionurl>price/priceLimitSummary.xhtml</menuoptionurl>
		</menuoption>
		<!-- Settings & Admin > Plugins > Set up Price Settings -->
		<menuoption>
			<id>CUSTOM_PRICE_SETTINGS</id>
			<name>key_price_settings</name>
			<description>key_price_settings</description>
			<menuoptionparentid>MC_PLUGINS</menuoptionparentid>
			<menuoptionordernum>1</menuoptionordernum>
		</menuoption>
		<!-- Settings & Admin > Plugins > Set up Price Settings > Price Limit Settings -->
		<menuoption>
			<id>CUSTOM_PRICE_LIMIT_SETTINGS</id>
			<name>key_price_limit_settings</name>
			<description>key_price_limit_settings</description>
			<menuoptionparentid>CUSTOM_PRICE_SETTINGS</menuoptionparentid>
			<menuoptionordernum>1</menuoptionordernum>
			<menuoptionurl>price/priceLimitSettings.xhtml</menuoptionurl>
		</menuoption>
		...
	</menuoptions>
</menuoptionconfig>
 modules.xml
menuoptions.xml
<moduleconfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/modules.xsd">
    <modules>
        ...  
        <module>
            <moduleid>CUSTOM_PRICE</moduleid>
            <modulemainmenuoptionid></modulemainmenuoptionid>
            <modulename>key_price</modulename>
            <applicationid></applicationid>
                <features>
                 
                </features>
                <leftmenuoptions>
                   <id>CUSTOM_PRICE</id>
                   <id>CUSTOM_PRICE_LIMIT</id>
                </leftmenuoptions>
                <settingmenuoptions>
                    <id>CUSTOM_PRICE_SETTINGS</id>
                    <id>CUSTOM_PRICE_LIMIT_SETTINGS</id>
                </settingmenuoptions>
        </module>
        ...
  
    </modules>
    <loginmodules>
        <moduleid>CUSTOM_PRICE</moduleid>
    </loginmodules>
</moduleconfig>

For a full list of metadata menu options attributes, go to Menu options metadata.