?
avatar RichardZimmerEschborn
RichardZimmerEschborn
16 Jan 2019

Steps to reproduce the issue

When creating a module in joomla administrator (menu: extensions modules) in the advanced tab there is a field for selecting the module tag. Opening the combobox for the module tag, there is only block type tags available.

Expected result

I would like to see also a tag available to create inline modules.

For example: Creating a module with the name 'Telephone number' and the content '+49 12345' would lead to including the telephone number in any article by just including the module, without line breaks. Later changing the content of the module would update the telephone number on thousands of pages on the fly.

As an example the result using the module should generate output like the following:

Please give us a call under +49 12345 and we will see how to help you.

Actual result

The result today created with a module based on a

tag looks like the following:

Please give us a call under
+49 12345
and we will see how to help you.

System information (as much as possible)

joomla 3.9

Additional comments

avatar RichardZimmerEschborn RichardZimmerEschborn - open - 16 Jan 2019
avatar joomla-cms-bot joomla-cms-bot - change - 16 Jan 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Jan 2019
avatar RichardZimmerEschborn RichardZimmerEschborn - change - 16 Jan 2019
The description was changed
avatar RichardZimmerEschborn RichardZimmerEschborn - edited - 16 Jan 2019
avatar RichardZimmerEschborn RichardZimmerEschborn - change - 16 Jan 2019
Title
inline module
Feature request: inline module
avatar RichardZimmerEschborn RichardZimmerEschborn - edited - 16 Jan 2019
avatar Ninja-007
Ninja-007 - comment - 16 Jan 2019

What about creating a HTML module with text 'Please give us a call under +49 12345 and we will see how to help you.' and hiding the module title?

avatar RichardZimmerEschborn
RichardZimmerEschborn - comment - 16 Jan 2019

What about creating a HTML module with text 'Please give us a call under +49 12345 and we will see how to help you.' and hiding the module title?

Thanks for your suggestion, but the module (in this case the telephone number) is supposed to be used in different sentences. It would need to create a module per unique paragraph the telephone number is to be used in. The title is not shown anyway.

avatar RichardZimmerEschborn
RichardZimmerEschborn - comment - 16 Jan 2019

I could even think of, instead of surrounding the modul with a div or a span tag, give the chance to not surround it at all. This way ALL of the html would be generated by the module.

avatar joomdonation
joomdonation - comment - 16 Jan 2019

isn't this plugin https://www.regularlabs.com/extensions/rereplacer is what you need?

avatar Bodge-IT
Bodge-IT - comment - 16 Jan 2019

You can do this with a free plugin from the community from RegularLabs called Snippets. It allows the use of shortcodes as a placeholder for any custom text. It also allows for the removal of block elements surrounding it.
Under some circumstances you may also be able to change the modulechrome (Module Style) and set it to none. Haven't tested this but may work. A module for this seems a bit of overkill.

avatar RichardZimmerEschborn
RichardZimmerEschborn - comment - 16 Jan 2019

Plugins are awful! I do already have tried with plugins. They install huge libraries just for simple tasks. I get the feeling plugins, more even templates are written, just to create dependencies, instead of extending joomla concepts. What do I need a plugin for, to do what the base system can do, if the flexibility is not intensionally limited.

avatar ciar4n
ciar4n - comment - 16 Jan 2019

Presuming I understand you correctly, you can set the 'Module Style' (chrome) to 'none' and add your number inside a span in the content area.

avatar RichardZimmerEschborn
RichardZimmerEschborn - comment - 16 Jan 2019

Presuming I understand you correctly, you can set the 'Module Style' (chrome) to 'none' and add your number inside a span in the content area.

Thanks for the advice. I did not find an option for chrome in the module definition. I found an Advanced Option called Module Style. Setting this to none does not change anything in the appearance.

avatar RichardZimmerEschborn
RichardZimmerEschborn - comment - 16 Jan 2019

So, what happens is the following:
In my article I write in html mode of the editor <>:

<p>Please call our hotline {loadmodule mod_custom,Telephone} to get help</p>

Joomla generates this in the page:

<p>Please call our hotline</p>
<div class="custom"><p><span>+49 12345</span></p></div>
<p>to get help</p>

The additional <p></p> around the <span></span> is already done by the editor. All this is not needed!

I do understand the additional <div class="custom"></div> because this is selected in the Module Advanced Module Tag. The additional <p>...</p> is not needed at all.

Richard

avatar mbabker
mbabker - comment - 16 Jan 2019

You're rendering the module. So you're getting what comes out of its layout, not just what you put into the editor. The mod_custom layout wraps output in that <div class="custom"> container.

Regarding the wrapping <p> tag around your <span>, IIRC the default TinyMCE configuration forces everything to be wrapped in a block element. Since a <span> is not a block element, the editor considers that as being required to be wrapped.

It truthfully sounds like one of the extensions suggested in this thread better suits your use case than anything that could be offered in core. The only other way I could think you could make core work is to have a custom layout for mod_custom that doesn't have the wrapping <div>, but you're then still having to work around the TinyMCE configuration if you really want your text to not be wrapped in another element.

avatar Bakual
Bakual - comment - 16 Jan 2019

I'm closing this. Please use the forum for further support.

avatar Bakual Bakual - close - 16 Jan 2019
avatar Bakual Bakual - change - 16 Jan 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-01-16 14:30:05
Closed_By Bakual
avatar RichardZimmerEschborn
RichardZimmerEschborn - comment - 16 Jan 2019

Well, why limiting to blocks, why installing a complicated extension, instead of just taking the limitation to blocks out of the core? This does not make any sense!

avatar mbabker
mbabker - comment - 16 Jan 2019

It is not a Joomla imposed limitation. The editor has a sane set of defaults that tries to ensure HTML elements are somewhat correctly structured, and for the 80% use case ensuring elements are wrapped in a valid block element (<p>, <div>, etc.) is the right thing to do. You've reached a case where this behavior (or rather, the entire module) doesn't fit with your desired workflow. So it's not wrong to suggest using another tool that better suits your workflow.

Other core only alternatives include changing to another editor that does not alter the input (such as CodeMirror) while editing this module instance to ensure it generates the output you expect, creating a custom layout for the mod_custom module that has only the HTML you want in it, or potentially seeing if custom fields would be a viable solution for you.

avatar RichardZimmerEschborn
RichardZimmerEschborn - comment - 17 Jan 2019

Well, I understand, the editor is forcing stupid stuff. So let's use a different editor, like already suggested.

This is no argument, that Joomla is also forcing stupid limitations. Either have Joomla not force a tag around, or allow also inline tags. I have no problem with the address, div, ... tags, I just suggest to also allow a span tag or allow to not have a tag around at all.

Why does Joomla be so difficult in all places. I get the feeling that all over the place there is limitations forced into Joomla which later on has to be opened by installing plugins, which then implement dependencies, upgrade problems, ... Just to verify that every plugin works before installing an update (and that is, what serious administrators should always do) is a huge effort! Is Joomla a host for plugin developers to sell there components or is Joomla an open platform to develop websites?

Just allow the administrator do do what needs to be done instead of forcing him do install workarounds!

avatar Ninja-007
Ninja-007 - comment - 17 Jan 2019

@RichardZimmerEschborn May be you can suggests code changes and do a pull request after that. If community get convinced of its usefulness then they will merge in the repo.

avatar RichardZimmerEschborn
RichardZimmerEschborn - comment - 17 Jan 2019

I already looked into the code. The code, also is so complicated in many places and the documentation is sooooo bad (actually it is the worst documentation I have found in my former live as a developer), that I cannot afford to reverse engineer everything to develop Joomla. At least not right now. I have to run a business and I have to develop a website. This is already more, than I can handle.

avatar Bodge-IT
Bodge-IT - comment - 17 Jan 2019

I disagree plugins are aweful, I'd say they one of the most powerful features of the core but that's another debate, I'll repeat my last suggestion:

Under some circumstances you may also be able to change the modulechrome (Module Style) and set it to none. Haven't tested this but may work. A module for this seems a bit of overkill.

This is in the Advanced section of the module config.

avatar Bakual
Bakual - comment - 17 Jan 2019

Please stop the discussion here and take it to the forums.
The issue already is closed and it was stated that there is nothing core can do to fix it. Alternative solutions were offered. Nothing more can be done here.

avatar Ninja-007
Ninja-007 - comment - 17 Jan 2019

@Bodge-IT
I tried the advanced module style. it did remove the template div, but div added by custom_module layout remained there.

Joomla 3.9.2
Template Breez3

Custom module HTML content
<p>+49 1513 333 5552</p>
Title hidden

Module tag=div
Module style=inherited
<div class="well ">
	<div class="custom"  >
		<p>+49 1513 333 5552</p>
	</div>
</div>

Module tag=div
Module style=none
	<div class="custom"  >
		<p>+49 1513 333 5552</p>
	</div>

This is my last reply unless someone reopens the issue.

avatar RichardZimmerEschborn
RichardZimmerEschborn - comment - 17 Jan 2019

Bodge-IT: > I disagree plugins are aweful, I'd say they one of the most powerful features of the core

Usually I would agree, especially if a plugin is just a snippet for a certain task. In Joomla, plugins import huge libraries, which nobody knows what they are doing, same a templates, which try to implement a complete system inside of Joomla. The problem is not the feature of plugins itself, but the way the large providers are trying to misuse plugins to create dependencies.

avatar Bakual
Bakual - comment - 17 Jan 2019

For the third and last time - please use the forum.
I'm locking this thread now.

Add a Comment

Login with GitHub to post a comment