1

I develop a custom module and I need this module to show some pictures choosen in backend. So... I declare a parameter with type "imagelist" in my module xml file.

    <fields name="params">
        <fieldset name="advanced">
            <field
                name="project1-image"
                type="imagelist"
                directory="???\images"
                label="..."
                description="..." />
        </fieldset>
    </fields>

The problem is "images" dir located in some Joomla template. Is there maybe some constant like "JPATH_COMPONENT" or "JPATH_BASE" pointing to currently applied template to site? Or I need force site admin to write filename and find it in php file of my module, this seems like a bad solution.

Thanks in advance, Andrey!

1 Answers1

0
    <field name="myimage" type="imagelist" default="" 
label="Select an image" description="" directory="images" exclude="" stripext="" />

directory (optional) is the filesystem path to the directory containing the image files to be listed. If omitted the directory given by JPATH_ROOT is assumed.

You can also use <field name="myimage" type="media" directory="stories" /> This will open the media manager with the directory /images/stories/ already selected.

anagha affinity
  • 273
  • 1
  • 3
  • 14