1

Im quite new to joomla. As far as I understood, modules can be used in an article like building blocks. Example:

{loadmoduleid 117}

Goal

I would like to give article authors a simple method to add unified features to an article without needing to create a new module for example for a small image gallery or specialised item list.

Question

Is it possible to provide parameters to a module? For example a link to an image and a text string:

{loadmoduleid 117 | /images/myimage.jpg| This is my image}

The module should the be able to scan parameters and place them for example in an html template like this:

<img src="$PARAM1" alt="$PARAM2">

The resulting code would be

<img src="/images/myimage.jpg" alt="This is my image">

Note

Please note: my question may be poiting in the wrong direction. There may already exist a different mechanism for achieving my desired result.

2
  • 1
    Welcome to JSE, Georg. Please take our tour while you wait for support/feedback. Do you need to load a module? Could you perhaps like to load an article instead? Can you give a bit more context about your goal? Dec 4, 2021 at 21:06
  • Thanks for your hint. I have added a little more information on my goal.
    – Georg W.
    Dec 6, 2021 at 8:21

2 Answers 2

1

You might prefer to use a custom field for this. It would make it more user friendly for authors.

Should you want to do this here's a free field developed by Elisa Foltyn. https://github.com/coolcat-creations/plg_fields_owlimg

You can also find her tutorial here: https://coolcat-creations.com/en/blog/tutorial-build-your-own-custom-field-plugin

Whereas a module would appear on each page, you would have to set each image parameters in the URL/Shortcode as you are suggesting. Which would need you to write a plugin.

Using Elisa's method you would simply need to install the field and assign it to the correct categories and then it would appear in a tab. Must more user friendly and has the added benefit of allowing multiples in an Owl Carousel.

Plus it will allow you to upload images too.

2

No, it is not possible. Parameters are defined in the module instance with the given ID. You'd need a custom shortcode plugin to pass any parameters.

1
  • Thanks! Is there another solution that may be used to achieve what I want?
    – Georg W.
    Dec 6, 2021 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.