1

I know in a template you can add

<jdoc:include type="modules" name="newposition"   />

and then within the positions tags you add your new position.

<positions>
     <position>newposition</position>
</positions>

But I also know you can just create a position out of nowhere by typing it in the module back end in the position slot.

Adding a new module position in the Joomla! module backend

And then you can do module loadposition.

{loadposition some_position}

But if I echo this text in my module it's just text (a string). If I echo the XML that's also a string, but I never expected that to work as it's not in the XML file.

Is it possible to add a module position within a module?

I'd rather do this the built in Joomla! way than using any extensions.

1

It probably depends on specific circumstances. I have custom modules that contain several 'secondary' modules. I accomplish this using the Modules Anywhere extension and add {example module} to the code for the module I'm putting it in. You don't need to include a module position in the module settings to use Modules Anywhere.

https://extensions.joomla.org/extensions/extension/core-enhancements/coding-a-scripts-integration/modules-anywhere/

  • Hmm, yes, I'm aware of that extension and it is useful. – Eoin Dec 29 '18 at 0:09
0

You need to switch on the content plugin

Trigger the onContentPrepare plugin event

https://docs.joomla.org/Triggering_content_plugins_in_your_extension

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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