Create two login modules on a page such as here: http://kgbfacilityservices.co.uk
I know they do the same thing but this is what the client wanted.
ID should only be used once in a page
ID is used as many times as the module is used.
n/a
I know this is an unusual use of the login module, but it is still a module and thus it could be used multiple times on any page. Potentially in the footer and a sidebar. Or in a popup or menu item as well as visible lower down the page. On the whole I do not think modules should contain an ID as they are meant to be repeatable. A class is probably sufficient for styling purposes.
Open to input from other people as there may be a counter argument.
This would have to be a J4 change to avoid b/c breaks.
Labels |
Added:
?
|
Same problem here: in 3.x as well as in 4.0. https://issues.joomla.org/tracker/joomla-cms/23070
@brianteeman that is a good solution that would work. The website has been live for years and it causes me no issues. But a good suggestion, thank you.
It does not detract from the overall premise that modules are designed to be repeatable, and should therefore not contain an ID. I would think it should be a rule that this is not permissible in a module. There's an ID in the search module too.
For clarity @chmst is talking about #23397 (comment)
Title |
|
It does not detract from the overall premise that modules are designed to be repeatable, and should therefore not contain an ID. I would think it should be a rule that this is not permissible in a module. There's an ID in the search module too.
Actually, the Smart Search module is an OK example of cases where IDs can be used (even if it were using classes, with the JavaScript interactions you'd still need it to explicitly target the single module's markup and not every instance on the page). The problem is having unique identifiers and not duplicating them (which isn't that hard to pull off thanks to scope leakage, the $module
object is available in layouts and you've generally already got a unique identifier in the id
property). So it's not inherently "ID is bad", it is "non-unique ID is bad" and THAT is the issue to be addressed.
Good point, modules already have a unqiue ID, so it would simply be a pull request to add that to the existing ID and then update the JS to understand that right?
Status | New | ⇒ | Discussion |
Status | Discussion | ⇒ | Information Required |
Category | ⇒ | com_modules |
Title |
|
Labels |
Added:
?
|
Labels |
Added:
J3 Issue
|
@franz-wohlkoenig my apologies I've been away. Sure I'll do a pull request against J4.
Title |
|
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-05-17 08:19:21 |
Closed_By | ⇒ | franz-wohlkoenig | |
Labels |
Added:
?
Removed: ? |
Personally I would just create two different layouts and put unique ids in the layouts