[4.0] wrap message container output in an array and implode it so it prevents obsolete spaces#30760
[4.0] wrap message container output in an array and implode it so it prevents obsolete spaces#30760richard67 merged 12 commits intojoomla:4.0-devfrom hans2103:trim-system-message
Conversation
|
I don't see much benefit from this except if you want to style your system messages different you have to override multiple files |
|
Do you? You can still just override the first and dont load the seccond one in that override right? |
|
The benefit is having |
|
Just fix fix the markup in the first file. But creating an additional file for only copy the content to the new file doesn't make much sense to me. |
|
@HLeithner sorry... I had no intention to add the extra tabs at the beginning of the file. They have been removed with commit 1ce10bb But the onliner |
|
Thank you @HLeithner for the suggestion of this easy solution. 👍 |
|
Could you update the title please |
|
JS needs updating. Though I don't think is a good idea at all. Relying on markup to contain/not contain whitespaces is too volatile. Wouldn't use |
|
Though this simple else statement can help frontenders to get rid of obsolete margins. please consider merging this PR. It will benefit styling |
Yes, I know. |
|
The implementation of
@SharkyKZ can you explain this? Where and why does JS need to be updated? |
|
Btw, we have code in mod_menu (maybe not anymore) with a comment that the markup shouldn't have any whit-spaces. If needed ok but if not really necessary I'm not sure we should rely on such restriction. |
|
maybe it would better to set a class if empty and a class if content is added with js? |
|
@HLeithner fine by me... If I just can remove spacing when there are no alerts to be shown. please make a PR on mine with your suggested change |
When you close the messages, the div contains whitespaces. |
|
@SharkyKZ So the suggestion of @HLeithner to toggle a className when messages are shown or not is an option? |
|
I have tested this item ✅ successfully on e440e42
I don't see any visible differences in front or back-end (in Firefox/Mac). This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30760. |
I don't think so. When the message is removed by clicking the (I have tested this) As you can see there is no obsolete space within this element. And that is what I want to achieve. No obsolete space. |
|
@hans2103 Drone javascript-cs: https://ci.joomla.org/joomla/joomla-cms/36799/1/23 |
|
I see the message... but there are no JS changes in this PR. |
|
@hans2103 Maybe it helps if you update the branch to latest 4.0-dev? |
|
merged with latest changes from 4.0-dev |
Seems it helped 😄 |
|
I have tested this item ✅ successfully on c498183 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30760. |
1 similar comment
|
I have tested this item ✅ successfully on c498183 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30760. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30760. |
|
Thanks! |
|
🤦♂️ |
|
@SharkyKZ It's bad? Have I missed some open discussion? If so, could you make a new issue for it? |
|
Hmm, I see, it was hidden by default because too long comment history. @HLeithner Shall we roll back? |
|
@SharkyKZ wrote: #30760 (comment)
In Joomla 3 the file media/plg_installer_webinstaller/js/client.js line 81 makes a reference to #system-message. In Joomla 4 there is no Javascript reference to #system-message anymore. |
|
PR #31195 created to remove obsolete div element with id = system-message and remove obsolete css referring to this element. |

Pull Request for Issue #30759 .
Summary of Changes
When styling the messages and spacing around it I would like to be able to hide the message box when empty using the following CSS. It is clean, it is simple...
Because the opening of PHP starts on a new line there is some obsolete spacing rendered.
The CSS statement above is not working due to these obsolete space characters.
When PR is merged the empty message box will appear together with its spacing.
This PR moves the rendering of the
joomla-alertto its own JLayout.The idea behind this is that
<div id="system-message"><?php echo $output; ?></div>can be a oneliner which collapses to the AFTER result when rendered empty.Testing Instructions
Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
Documentation Changes Required