Hide module if nothing to display

  • fguyon
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
1 year 6 months ago #50462 by fguyon
Hey
I'm upgrading my website to J4 (only now...).
In the J3 website, the module isn't displayed if no content to show (empty); I don't remember how I did !??
In J4, it's displayed (the intro text "Breaking new" and the | ) : how to show the module ONLY if there is something, content, to show (active or still within the end of publication) ??
Thanx for your suggestions.
Regards

Please Log in to join the conversation.

  • milos
    Support Staff
  • Moderator
  • Moderator
More
1 year 6 months ago #50463 by milos
Hello,

I just tested the module on J3 with the Sportal template and if there are no articles to show, the intro text is still displayed. Exactly the same behavior on J4. So, I can't see any difference. If you want to hide the module completely, you can simply unpublish it. Also, maybe there are other solutions, but I will need to see your website live (please provide the link).

Regards,
Milos

Please Log in to join the conversation.

  • fguyon
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
1 year 6 months ago - 1 year 6 months ago #50464 by fguyon
Last edit: 1 year 6 months ago by fguyon. Reason: Adding prtscr

Please Log in to join the conversation.

  • fguyon
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
1 year 6 months ago #50465 by fguyon
And it's not acceptable to simply publish or unpublish the module because it's a club website and the coaches may write breaking news using a specific cateogry where to store the content and set a limit date for publishing it : anyone of them can do that at an undefined moment : the module is always published and shows content when there is some then disappears completely when nothing.

Please Log in to join the conversation.

  • milos
    Support Staff
  • Moderator
  • Moderator
More
1 year 6 months ago - 1 year 6 months ago #50466 by milos
Hello,

Ok, but I see on your website that the scroller module already has applied "display: none" to the scroller container and it's not displayed on the page. Did you add some Javascript that does this yourself?

The idea is to apply a simple Javascript that will hide the scroller container if it's empty (if no articles). I see it's already applied on your website and the Scroller intro text (in your case "Flash info") is not displayed anywhere.

However, on the second link, the NAV container where the module is published is not hidden. So, the Javascript that hides the scroller should be modified to hide the parent NAV container of the module.

Regards,
Milos
Last edit: 1 year 6 months ago by milos.

Please Log in to join the conversation.

  • fguyon
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
1 year 5 months ago - 1 year 5 months ago #50498 by fguyon
Hello
I know that I worked hard to get his result in the previous website but I don't remember what I did (2 years ago) !!
I'll search again to do it by myself but would it be possible to get it as "native" (as anoption with a button in the settings) in a next update ?
I keep thinking it's a great feature to do so !
Regards
François
Last edit: 1 year 5 months ago by fguyon.

Please Log in to join the conversation.

Time to create page: 0.102 seconds
Powered by Kunena Forum