Announcement

Collapse
No announcement yet.

Finer control over what Channels Notices appear in

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Finer control over what Channels Notices appear in

    The Notices Manager doesn't provide fine enough control over which Channels a Notice appears in. It doesn't provide a 'these but not those' option.

    I have a Notice that is applicable to all Forum Channels and child channels except Archives Channels and child channels. Can code be written for css_additional.css that would address this?
    The Linux Community has given me much. I do what I can to return the favor!

    #2
    glennrocksvb Thoughts?
    The Linux Community has given me much. I do what I can to return the favor!

    Comment


      #3
      Every page on vB5 has a page ID and a CSS class in the <body> tag is added that indicates this using the page<pageID> format. Find the page class for that Archive forum category. Then in the Notice configuration, choose "User is browsing channel [Home] or one of its child channels" option.

      Code:
      .pageXXXX .notice[data-notice-id="YYYY"] {
          display: none;
      }
      Where XXXX is the page ID and YYYY is the Notice ID you want to hide.

      I haven't tested this code but I think it should work.

      BUT the challenge with this is if you have a lot of forums and subforums inside the Archive category, then you'd have to do the same CSS code above for each child channel. If you have less categories than Archive child channels, then I guess it's more practical to just duplicate the notice for each category and show it for that category and its child channels instead of creating individual CSS code for Archive and its child channels. Does that make sense?
      Helpful? Donate. Thanks!
      Buy me a coffeePayPal QR Code
      Fast VPS Host for vBulletin:
      A2 Hosting & IONOS

      Comment


        #4
        Originally posted by glennrocksvb View Post
        Does that make sense?
        Yes. Our Archives area does have A LOT of sub-forums. I’ll have to think on this.

        Thank you for looking into this.
        The Linux Community has given me much. I do what I can to return the favor!

        Comment


          #5
          Originally posted by glennrocksvb View Post
          Find the page class for that Archive forum category.
          How do I do that?
          The Linux Community has given me much. I do what I can to return the favor!

          Comment


          • glennrocksvb
            glennrocksvb commented
            Editing a comment
            Navigate to the Archive forum category page. Right-click and choose Inspect and then locate the <body> tag and find the pageXXXX class there.

          #6
          Okay. Clicking on Archives from our Main Page takes me to Archives Page: https://www.kubuntuforums.net/forum/archives

          I right-click anywhere on the page and select Inspect Element. The opening <body> tag line is:

          <body id="vb-page-body" class="l-desktop page63 vb-page view-mode" itemscope="" itemtype="http://schema.org/WebPage" data-usergroupid="6" data-styleid="56">
          Is page63 the pageXXXX class?

          Yes it is. I used:
          .page63 .notice[data-notice-id="5"] {
          display: none;
          }
          The Notice I don't want displayed on that page is not displayed. But, as you pointed out, this works ONLY for that page. Navigating to the TWO Forums or any of the numerous sub-forums in those two, the Notice shows.
          The Linux Community has given me much. I do what I can to return the favor!

          Comment


          • glennrocksvb
            glennrocksvb commented
            Editing a comment
            Correct. You'll have to add similar CSS code for each child channel under the Archives category in order for the notice to be hidden in those child channels.

          • glennrocksvb
            glennrocksvb commented
            Editing a comment
            You can combine them in one CSS code:

            Code:
            .page63 .notice[data-notice-id="5"],
            .pageA .notice[data-notice-id="5"],
            .pageB .notice[data-notice-id="5"],
            .pageC .notice[data-notice-id="5"] {
                display: none;
            }
            Replacing A, B, C, and so on, with the corresponding child channel page IDs.

          • glennrocksvb
            glennrocksvb commented
            Editing a comment
            To my earlier point, that will be tedious if you have tons of child channels. If you have much less number of channels to show the notice to, it might be more practical to just duplicate the notices for those channels.

          #7
          Any way to specify 'equal to or greater than' when identifying the pageXXXX? I did a quick check, and all the pages under Archives are greater than page63.
          The Linux Community has given me much. I do what I can to return the favor!

          Comment


          • glennrocksvb
            glennrocksvb commented
            Editing a comment
            No, CSS does not have that kind of logic. All it sees in those page class names are just a bunch of numbers and it doesn't know which ones are greater or lesser..

          #8
          Well, it was worth a shot. Again, thank you for looking in to this. We simply have way too many sub-forums under EOL Releases. Most are not shown (but can be navigated to), but for pure esthetics I'd have to write the code for ALL of them, and that isn't something I'm willing to do.

          Having the notice displayed in and throughout Archives doesn't hurt anything. It informs members when to use QUOTE vs CODE tags in posts. As all the Forums and Sub-forums in Archives are closed to posting, the Notice is redundant.
          The Linux Community has given me much. I do what I can to return the favor!

          Comment

          Users Viewing This Page

          Collapse

          There is 1 user viewing this forum topic.

          • Guest Guest

          Latest Posts

          Collapse

          Working...
          X
          Searching...Please wait.
          An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

          Please push the back button and reload the previous window.'
          An unexpected error was returned: 'Your submission could not be processed because the token has expired.

          Please push the back button and reload the previous window.'
          An internal error has occurred and the module cannot be displayed.
          There are no results that meet this criteria.
          Search Result for "|||"