Have you considered using the "Data" module? You could create a new node type, define the according dialog and add the logos. In addition you would create a small paragraph "Select A Logo", which uses the "uuidLink" control to list the nodes from the "data" module.

The same thing you could also do with the DMS module as well. In fact, the DMS module has been made for this purposes.

I would not recommend adding the logos into the /config section of the module, because not only is it a little more difficult to maintain them (you have to add nodes and properties, rather than using a dialog), but the "logo" hierarchy is not configuration stuff.

But if you nevertheless want to add the "logos" to the module configuration, you can use the "Content2Bean" to read the nodes. The "samples" module uses the "ModuleConfig" and "ModuleConfigHelper" class to define the "setters" and "getters" for the "Content22Bean" class.

HTH
Giancarlo


On Oct 7, 2008, at 3:16 AM, Matteo Pelucco wrote:

Hi all!
I need a quick help to better understand how to read module config when I want to have structured configuration data like

[everything is under myModule / config]
- logos
 - logo1
   - path = "/logos/logo1.jpg"
   - displayName = "logo1"
   - width = "400"
   - height = "300"
 - logo2
   - path = "/logos/logo2.jpg"
   - displayName = "logo2"
   - width = "200"
   - height = "150"
 - logo3
   - path = "/logos/logo3.jpg"
   - displayName = "logo3"
   - width = "400"
   - height = "300"

I'm going to build a new control called "imagePicker".
The idea is to let the authors to select images from a predefined set.

Image set is defined using configuration.

Having a look into source code, I've found how to use custom module config, and it seems that there are 3 major use cases:

+++++++++++++++++++++++++++++++++++++++++++++++
A) Simple config
There is a simple config (String siteLiveUrl = "http:// www.google.com")

Configuration:
        [Node Data] siteLiveUrl (Type = String)
Java: get module instance and call getter method.

+++++++++++++++++++++++++++++++++++++++++++++++
B) Collection config
A collection of string, e.g. Collection jsFiles with 3 children.


Configuration
        [Content Node] jsFiles
          - [Node Data] file1 = "mootools.js"
          - [Node Data] file2 = "prototype.js"
          - [Node Data] ...
Java: using an iterator I can retrive stored values.

+++++++++++++++++++++++++++++++++++++++++++++++
C) Structured config
Nested Structured This is not so clear...

        [Content Node] grandfather
          - [Content Node] father
              - [Content Node] child
                - [Node Data] property1 = "a"
                - [Node Data] property2 = "b"

Can you quick explain me? Thanks so much..

Matteo


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------



----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------

Reply via email to