No Code Attached Yet
avatar diyfr
diyfr
29 Dec 2022

Steps to reproduce the issue

Define an custom module, with suffixe class
see documentation here

Expected result

Suffix class append to custom module

Actual result

No suffix class

System information (as much as possible)

Current version 4.2.6 (and Master branch)

Additional comments

Solution :
Edit modules/mod_custom/tmps/default.php
replace L29

<div id="<?php echo $modId; ?>" class="mod-custom custom">
    <?php echo $module->content; ?>
</div>

by

<div id="<?php echo $modId; ?>" class="mod-custom custom<?php echo $params->get('moduleclass_sfx'); ?>">
    <?php echo $module->content; ?>
</div>
avatar diyfr diyfr - open - 29 Dec 2022
avatar joomla-cms-bot joomla-cms-bot - change - 29 Dec 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 Dec 2022
avatar sandewt
sandewt - comment - 29 Dec 2022

Is this issue only limited to the custom module? I suspect this is also the case for other modules.


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

avatar brianteeman
brianteeman - comment - 29 Dec 2022

This is not a bug and it is the intended behaviour that you will see in all modules.

The module class sfx is added by the module chrome

$moduleAttribs['class'] = 'moduletable ' . htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_QUOTES, 'UTF-8');

The module chrome is defined for the module position in the template - in this case the chrome is card

<jdoc:include type="modules" name="bottom-b" style="card" />

The chrome defined in the template can also be overridden at the module level here
image

In some templates you will see a module with a style=none
That means its using the chrome none.php and this one does not have the code wrapping the module output with the module class sfx

echo $displayData['module']->content;

avatar richard67
richard67 - comment - 29 Dec 2022

In addition it should be mentioned that the class is not a suffix anymore. It is not appended as a suffix but as a class, with a space, as you can see by the code mentioned in the previous comment. In the UI the field has been renamed, but the parameter name moduleclass_sfx has not been renamed for b/c reasons so that name might be a bit misleading when reading code.

avatar richard67 richard67 - change - 29 Dec 2022
Status New Expected Behaviour
Closed_Date 0000-00-00 00:00:00 2022-12-29 15:04:05
Closed_By richard67
avatar richard67 richard67 - close - 29 Dec 2022
avatar richard67
richard67 - comment - 29 Dec 2022

Closing as expected behaviour for the reasons mentioned in previous comments. Feel free to reopen if you think this is wrong.


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

avatar sandewt
sandewt - comment - 29 Dec 2022

Thks for the info

Add a Comment

Login with GitHub to post a comment