Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joomla Modules Custom classes #39806

Closed
niosme opened this issue Feb 6, 2023 · 9 comments
Closed

Joomla Modules Custom classes #39806

niosme opened this issue Feb 6, 2023 · 9 comments

Comments

@niosme
Copy link

niosme commented Feb 6, 2023

Steps to reproduce the issue

Add Custom class to joomla module from advanced settings in a module at the field class module.
e.g. custom module
or menu module

Expected result

custom class added next to mod-custom for custom module
for menu module next to mod-menu
e.t.c.

Actual result

No class added

System information (as much as possible)

Additional comments

@brianteeman
Copy link
Contributor

make sure that the module chrome for that module position is one that uses the class.

@niosme
Copy link
Author

niosme commented Feb 6, 2023 via email

@indotantra
Copy link

The Joomla module's advanced settings allow for adding a user-defined class.


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

@Scrabble96
Copy link
Contributor

@niosme asks "what is a chrome?"

A chrome is the styling for the module - it relates to style="name-of-style" in the index.php where the code to insert a module position is placed.

If you are using the Cassiopeia template, have a look in the index.php at line 135 where the 'topbar' menu module is. In that line it is style="none". Look further down at the 'top-a' module and you'll see it says "style="card". 'card' is the name of a chrome, which you'll find in /templates/cassiopeia/html/layouts/chromes/ along with another called 'noCard'.

In your module, go to the 'Advanced' tab and scroll to the bottom. There you'll see 'Module Style' where you can select various styles (chromes) including any that you design yourself.

If you're not using Cassiopeia and want to design your own chrome, you'll need to create the /html/layouts/chromes directory path and copy either 'card' or 'noCard' into a new file with a different name to use as a starting point as there is currently no option to do so via a template override.

@niosme
Copy link
Author

niosme commented Feb 17, 2023 via email

@Hackwar Hackwar added the bug label Feb 22, 2023
@niosme
Copy link
Author

niosme commented Feb 23, 2023

As i checked in the menu module and in custom module the params we get are the following
Joomla\Registry\Registry Object ( [data:protected] => stdClass Object ( [menutype] => footer-menu [base] => [startLevel] => 1 [endLevel] => 0 [showAllChildren] => 1 [tag_id] => [class_sfx] => testtt [window_open] => [layout] => _:default [moduleclass_sfx] => testtttaaa [cache] => 1 [cache_time] => 900 [cachemode] => itemid [module_tag] => div [bootstrap_size] => 0 [header_tag] => h3 [header_class] => [style] => 0 ) [initialized:protected] => 1 [separator] => . )

but the param [moduleclass_sfx] is never used inside the module.
also the bootstrap_size is never used and maybe some other parameters.
The same with the custom_module. This is a problem because we cannot attach a custom class to a module to style it or refer to it.

IMPORTANT ALSO:
There is no module title in those to modules. Show Hide Title not works. There's no where in code and cannot put a title label in menu module or in custom module.

@brianteeman
Copy link
Contributor

The solution is exactly what you have already beehn told by @Scrabble96. If you dont use a chrome/modulestyle then you will only get the content. You need to use a chrome/modulestyle

@Hackwar there is no bug here and it should be closed.

@niosme
Copy link
Author

niosme commented Feb 23, 2023

Yes. Using the html5 layout module looks like fixing the problem. The template cassiopeia in bottom and top positions have noCard or none witch not show the modules title and classes.
Its template configured like that should change module layout html5 ( style="html5" in template position) by default or inside module by the setting it have.
Yes close the topic is not a bug. Im sorry!

@alikon
Copy link
Contributor

alikon commented Feb 23, 2023

closing

@alikon alikon closed this as completed Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants