Announcement

Collapse
No announcement yet.

Hide static HTML modules based on url?

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

    Hide static HTML modules based on url?

    I have a static html module that is meant for only one of my subforums but I don't know how to hide the widget based on the url. Is this possible?

    #widget_206 {

    if url = 'the one I want it for' then display, else display: none;
    }

    something to that effect but I've seen no examples anywhere of how to make that a possibility. Perhaps a Javascript workaround inside the module itself if it's not possible via pure CSS.

    #2
    Each page has the page id as the <body> class with the format pageXXXX. Use that class in the CSS to show the module and hide from the rest by default.
    Helpful? Donate. Thanks!
    Buy me a coffeePayPal QR Code
    Fast VPS Host for vBulletin:
    A2 Hosting & IONOS

    Comment


      #3
      ok maybe I misspoke on this one, what about hiding modules on different channels

      #widget_206 [data-channel-id="28"] {
      display: none;
      }

      but this isn't quite working out like I had hoped it would, any thoughts?

      Comment


        #4
        ok, sorted it out...

        found this Glen, worked perfectly

        It is by design, rightly or wrongly, that Visitor Messages page is visible to the public. vBulletin staff says: A workaround is to hide the content of the page

        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 "|||"