- Issue created by @anaconda777
- ๐ซ๐ฎFinland anaconda777
It could be hidden with CSS:
.private-message-page-link {
display: none!important; /* Hide by default */
}.private-message-page-link:not(:empty):not(:contains("0")) {
display: block!important; /* Show if it doesnโt contain "0" */
}What is needed is just some html element around the number, now its plain number inside a tag and not possible to style without styling the a tag.
- ๐ต๐นPortugal dxvargas
Just passing by to say, I'm closing #3488248 โจ Add the ability to disable the number if it is 0 Active as a duplicate, in favor of this one.
The only difference is that in the now closed issue, there was the suggestion for the visibility of the zero to be configurable.
Please have this in consideration and proceed as you think it's better. - First commit to issue fork.
- Merge request !152private_message-3486047/3486047-do-not-show: Added the functionality to... โ (Open) created by sourabhsisodia_
- ๐ซ๐ทFrance zenimagine
Patch #3 does not work for me, the 0 appears 5 seconds after reloading the page
- ๐ซ๐ฎFinland anaconda777
That is true what @zenimagine says, the Ajax refresh rate in the notification block somehow overwrite this, and the patch #3 does not work then when the first refresh comes.
- ๐ฎ๐ณIndia prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
@sourabhsisodia_ can you fix the stylelint, eslint and phpcs fixces for raised mr.
- ๐ซ๐ทFrance zenimagine
I just tested the patch. It hides the number if it is equal to 0. It is very good, but it creates another problem:
The icon disappears with the 0, the icon must appear empty if it is 0
@zenimagine Resolved the issue as mentioned above , please review now.
- ๐ซ๐ทFrance zenimagine
Could not apply patch! Skipping. The error was: Cannot apply patch https://git.drupalcode.org/project/private_message/-/merge_requests/152....
This is the last Commit . And it has bring changes in css only . was the patch working previously ??
- ๐ซ๐ทFrance zenimagine
I am on version 3.0.4 do I need the dev? yes it worked before
@zenimagine If everything looks good then please move the issue to RTBC state
- ๐ซ๐ฎFinland anaconda777
Hi,
Thank you for fixing the patch. But for my use case its problematic because it hides the link also.
I need the icon and also the link.So the current HTML is this:
<div class="private-message-notification-wrapper hidden"> <a href="/private-messages" title="You have no unread threads" class="private-message-page-link">0</a> </div>
If it would be like this, so that the value would have its own style class, it would be easier to hide just the number and leave the link:
<div class="private-message-notification-wrapper"> <a href="/private-messages" title="You have no unread threads" class="private-message-page-link"> <div class="private-message-inbox-amount">0</div> </a> So if the value would have any HTML element it would be possible to hide it with CSS and the link would be still there. </div>
- ๐ซ๐ทFrance zenimagine
I confide, with the patch when I click on the icon (without new message), it doesn't give me anything. There is no link.. I take the opportunity to ask to direct the icon to a personalized link like "inbox" (with all the discussion threads) and not to the unread discussion thread (this is completely illogical)
- Status changed to Needs work
about 2 months ago 10:28am 18 February 2025 - ๐ซ๐ฎFinland anaconda777
so the functionality should be
1. When no new messages, there should be icon/link to inbox (without any numbers)
2. when there are new messages, there should be icon and the link like in step 1 but also number showing how many unread messages. The link should always go to inbox or a custom url. It is not universal way and logical to link user to just some unread message, the inbox is the only place where this should link.Make always user interface which is known from the most used services.