nov 24, 2021 11:25 AM - editado nov 24, 2021 11:26 AM
I'd like to be able to store module snippets for users to insert when editing a custom module with Rich Text. It would be great if we could extnd this to other areas outside a custom module as well.
In essence, we are trying to achieve a "shortcut" to insert the output of a module while in the page builder. We can copy/paste the module's snippet into a Rich Text Editor field (RTEF), and the module renders fine. But finding the module snippets is not easy, and has to be documented elsewhere currently.
I realize modules cannot be Drag and Drop (DND) directly into another module, so this is the only workaround we have so far - to paste that module's "snippet" into a RTEF
Currently we have to paste it in like this:
We'd like to be able to refer to inserting that module snippet in an easier way - perhaps the "insert" menu in a RTEF:
Any ideas how to add somethign to the "insert" capabilities in the editor? Other ideas on how you insert module snippets other than keeping a library of them and pasting them in directly?
nov 24, 2021 5:49 PM
Hi @CP-BWG,
I'm also looking for this kind of feature to add modules inside modules to expand the default features.
If you have created a custom module, you can use a replace function withing the module.
So your code example will look like this:
{{ module.text|replace('[city]', module.city_name_hubdb.columns.city_name) }}
See the screenshot for setting up the custom module:
Hope this will make life easier!