Topic-icon SCLogin Module Class Suffix Ignored?

Active Subscriptions:

None
9 years 5 days ago #52603 by ralfmason
When adding a custom css class using the Module Class Suffix under Advanced properties of the module configuration the class is not rendered in the output HTML:

Could this be a bug?
The topic has been locked.
Support Specialist
9 years 5 days ago #52616 by alzander
Probably not. The SCLogin module uses Joomla's built-in system for adding the module class suffix. Joomla will only add the suffix to modules positions that are specified to be rendered as XHTML by the template. Some template positions, like in a 'search' position or top-bar spot don't get rendered this way by the template and therefore Joomla can't add the suffix.

I'd recommend trying to put the module in a different position to see if that works and/or try another module that supports the moduleclass suffix in the same position as the SCLogin module to see if it properly gets one. That will help narrow things down.

If you still run into issues though, let us know a URL we can test with and we'll gladly help however we can.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
9 years 4 days ago - 9 years 4 days ago #52621 by ralfmason
Hi Alex,

Thanks for your response. I have tried moving the SCLogin module to another position ('position-7' in the T3 blank template, original position is 'position-0') and as you say it renders the class correctly in the HTML.

However I already have another search module in the same position ('position-0') which specifies the same class using the Module Class Suffix and renders it correctly in the HTML. I would expect the SCLogin to behave in the same way?

Thanks

Ralf

(Digging deeper I think the problem is that the Module Class Suffix is being applied to the wrong Div. At the moment it is being applied to:

'div class="t3-module module customFloatRight " id="Mod123"'

which is not rendered when the module is placed in position-0. The Module Class Suffix should be applied to the div:

'div class="sclogin sourcecoast" id="sclogin-123"'

which is nested one level lower inside and is rendered at all positions.
Last edit: 9 years 4 days ago by ralfmason.
The topic has been locked.
Support Specialist
9 years 4 days ago #52643 by mel
It seems like you've narrowed down the issue to be related to either Joomla or your template. If you run into any other problems that you think are caused by SCLogin, please let us know.

-Melissa
The topic has been locked.
Active Subscriptions:

None
9 years 2 days ago #52685 by ralfmason
Hi Melissa,

No this looks like an issue with the SCLogin module because as I explained other modules work correctly.

Thanks

Ralf
The topic has been locked.
Support Specialist
9 years 1 day ago #52689 by alzander
The SCLogin module is doing it the Joomla-recommended way. We allow Joomla to automatically add the moduleclass suffix when the template requests for it to do so.

The Search Module (and the mod_menu) break Joomla's own conventions and includes the class suffix inside the layout file itself. This means that if you were to place it in position-7, there would actually be 2 divs with the class suffix on it. While that may work on your site, it would cause multiple issues on many other sites, so we don't specifically include the class suffix inside our layout file.

The search and menu modules do this, as best as I can tell, because they are often placed in these containerless divs like position-0 on your site.

Joomla's own login module, mod_login does *not* add the class suffix. The same is true for every other core module, as far as I know. We go by the standards Joomla sets to prevent conflicts on the vast majority of sites.

With all that said, if you'd like to force the class suffix so that it will always show at least once, you can follow our SCLogin theme guide to create a template override. Then, you just need to add a surrounding div to the entire output, like:
<div class="mod_sclogin<?php echo $moduleclass_sfx ?>">
... all our code...
</div>

I hope that helps explain,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 11 months ago #52733 by ralfmason
Hi Alex,

Thanks for the detailed explanation, which makes sense although I did test a couple of other third party modules which seemed to work in position-0 but like you said the class suffix was then added twice for other positions (although this did not seem to affect their behaviour in other positions). As you say there does not seem to be a consistent way in which the Joomla conventions are implemented for modules in position-0, even with the Joomla core modules!

Thanks

Ralf
The topic has been locked.
Support Specialist
8 years 11 months ago #52745 by alzander
It's definitely a bit haphazzard on what to do or not. For the login module, we simply follow what Joomla's standard login module does as that's what template designers generally should be designing to as well.

The problem with it being duplicated is that if, for instance, you had a suffix of "with-border" which had a style like:
.with-border {
border: 1px solid black;
}
That border would show up on both elements (creating a double box) in the case where there are 2 suffixes inserted but only once in the positions where there is only one suffix. You may not see issues, but if we added an additional suffix, others would complain about duplicated styles in their templates.

Again, you can override our output very easily to add the extra style, or anything you want.. it's just not something we'll do in a future release.

As always, if you have any feedback or suggestions, just let us know.

Thanks,
Alex
The topic has been locked.