Within the Venddor IO framework, each module resides in its unique folder found inside the app/modules directory. This module is characterized by the module.xml file.
This file lists down essential details about the module, such as its unique identifier, priority, version, display name, and more.
Interestingly, with just this file in existence, a module is fully operational. It would only appear in the module list and remain inactive. Yet, it's installable, uninstallable, and even configurable. If settings and translations are defined within the module.xml, they will be acknowledged.
Let's dive in and craft your very first Venddor IO module.
Your module.xml should resemble:
<?xml version="1.0"?>
<module scheme='3.0'>
<id>hello_world</id>
<version>1.0</version>
<name>Hello World</name>
<description>Say hello to the world</description>
<priority>100500</priority>
</module>
Upon logging into your Venddor IO admin dashboard and navigating to Modules, your new module should be visible, and you can activate or deactivate it accordingly.
Incorporating Settings: To advance your module, introduce settings within the module.xml file. Settings are organized into sections, each with individual items that contain specific parameters like name, type, and default values.
Append the following after <priority>100500</priority>:
<settings>
<sections>
<section id="general">
<items>
<item id="some_prop">
<name>Enter any text</name>
<type>input</type>
<default_value>Hello World!</default_value>
</item>
<item id="some_dropdown">
<name>Pick a value from the list</name>
<type>selectbox</type>
<default_value>blue</default_value>
<variants>
<item id="red">
<name>Red</name>
</item>
<item id="green">
<name>Green</name>
</item>
<item id="blue">
<name>Blue</name>
</item>
</variants>
</item>
</items>
</section>
</sections>
</settings>
Re-install your "Hello World" module and explore the settings you've just embedded.
Building a simple module wasn't a challenge, was it? However, as we proceed, we'll look into crafting intricate and functionally rich modules for Venddor IO. Stay tuned!