No Code Attached Yet
avatar EvDoorne
EvDoorne
30 Sep 2020

Steps to reproduce the issue

  • Publish a mod_custom module in a position that is generated via the {loadposition position_name} code.
  • Set a class in the field 'Module Class' under the 'Advanced' tab of the module.
  • Set the Module Style to 'Inherited' (which is the default setting).

Expected result

Output "<div class="mod-custom custom">" has the user set Module Class added,
i.e. "<div class="mod-custom custom my-custom-class">" .

Actual result

The user set Module Class is not added, the output remains "<div class="mod-custom custom">".

System information (as much as possible)

  • J!4 beta 4
  • Cassiopeia template

Additional comments

Custom class(es) set in the Module Class field will be generated:

  • when setting the Module Style to 'default (template: Cassiopeia)';
  • when publishing the module in a module position that is defined in templateDetails.xml.

Votes

# of Users Experiencing Issue
2/2
Average Importance Score
4.00

avatar EvDoorne EvDoorne - open - 30 Sep 2020
avatar joomla-cms-bot joomla-cms-bot - change - 30 Sep 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 30 Sep 2020
avatar drmenzelit
drmenzelit - comment - 1 Oct 2020

If the module position has no style set it is an expected behaviour. The module chrome "none" doesn't render the div where the module class should be.

avatar EvDoorne
EvDoorne - comment - 2 Oct 2020

Thank you Viviana, I would agree with you if the Module Style was set to 'none' . But the Module Style is set to 'inherited'. Here, using the Cassiopeia template, the surrounding div "<div class="mod-custom custom">" is generated but the Module Class is omitted in that div, wether the Module Class is set or not.

avatar drmenzelit
drmenzelit - comment - 2 Oct 2020

Which style has the position (in index.php) where you want to have the module? If the position has style: none, then the module will inherit it.

avatar cloudfaction
cloudfaction - comment - 9 Feb 2021

setting the style to html5 does the trick. however, i agree, when inherited is used, you would expect to see the custom style applied. now this only works with html5 as module style. Even more, the bootstrap size only work when html5 is selected, of not setting bootstrap size has no effect.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30822.

avatar mtechoh
mtechoh - comment - 3 Feb 2022

This appears to still be an issue. mod_custom default template doesn't reference the module class at all:

And unless I'm missing something, most of the mod_* items ignore the module class and don't attempt to make moduleclass_sfx available.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30822.
avatar drmenzelit
drmenzelit - comment - 3 Feb 2022

"Inherited" means the module will take the style defined in the template position
<jdoc:include type="modules" name="bg" style="none" />
If the position has style="none" the module will be loaded without chrome around. That is expected behavior.

avatar drmenzelit drmenzelit - change - 3 Feb 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-02-03 07:30:50
Closed_By drmenzelit
Labels Added: No Code Attached Yet
Removed: ?
avatar drmenzelit drmenzelit - close - 3 Feb 2022
avatar mtechoh
mtechoh - comment - 3 Feb 2022

Perhaps this is just an adjacent issue, then, but re-read my comment and check the code in mod_custom/tmpl/default.php (and others). No individual module instance style is possible in the template on 4. This was possible in 3 and there was code there to pull the style from the module instance. Adding that code back in an override makes it possible again.

avatar plamenstoyanov
plamenstoyanov - comment - 13 Mar 2023

Thank you, mtechoh! Your solution solved the issue: class="mod-custom custom get('moduleclass_sfx') ?>"

Add a Comment

Login with GitHub to post a comment