FANDOM


  • Hello! I have one question regarding infoboxes. On Metro Wiki, we have infoboxes about weapons and achievements. Some weapons/achievements only appear in one game, some appear in multiple games. The infobox has a panel with several sections, each section is about a specific game. There are those labeled buttons at the beginning of the paneled part of the infobox that allow the users to switch between sections...

    My problem is that even if the weapon/achievement only appears in one game, the button for that one and only filled section still appears, even though it's not necessary at all, as there aren't multiple sections.

    See images below if you don't understand what I'm trying to say:

    2019-08-18
    2019-08-18 (1)

    How to tell the infobox to show these buttons only if more than one section has content?

      Loading editor
    • a link would be better than a screenshot.

        Loading editor
    • Okay. Here is an example of a paneled infobox with multiple sections: https://metrovideogame.fandom.com/wiki/Kalash_(AK-74M)

      And here's an example of one that only has one section but still displays the button for switching between sections: https://metrovideogame.fandom.com/wiki/Bulldog

      And here's the infobox template so that you can see how it's currently written (it is a bit messy at the moment, but hopefully understandable): https://metrovideogame.fandom.com/wiki/Template:Infobox_Weapon_Paneled

        Loading editor
    • you can do it via sitewide css. add following rule

      .pi-section-navigation .pi-section-tab:only-child{display:none}
      

      it will hide all single tabs in all infoboxes. if you want to narrow this, you will have to add some additional classes\names to the infobox.

        Loading editor
    • Thank you. I am not an admin there, so sadly, I can't edit CSS I guess, but I will ask somebody to help me.

        Loading editor
    • Update: I asked the admin to add this rule to site CSS but it didn't change anything. Is there another way of doing this or some possible explanation why it doesn't work?

      Here's a link to Metro Wiki's CSS: https://metrovideogame.fandom.com/wiki/MediaWiki:Wikia.css?useskin=oasis and in its history, one can see what changes were made and later reverted as they had no effect. Maybe the rule is correct and it just needs to be added in a different way?

        Loading editor
    • ah. those super-fast admins, that can't wait for couple of minutes to update a cache.

      there is a notice at the top of the page:
      Note: After saving, you may have to bypass your browser's cache to see the changes.
      
      Chrome - Windows: Hold the Ctrl key and press the F5 key. OS X: Hold both the ⌘ Cmd and ⇧ Shift keys and press the R key.
      Safari - Hold down the ⇧ Shift key and click the Reload toolbar button.
      Firefox - Windows: Hold the Ctrl key, and press F5. OS X: Hold the ⌘ Cmd and ⇧ Shift keys, and then press R.
      Internet Explorer - Hold the Ctrl key, and press F5 (or click the Refresh button).
      ensure that changes in the sitewide css were alive for at least 15 minutes (the cache have to be purged, of course) before considering them as "not working".

      moreover, we can't say what is going wrong if edit was rolled back. so, before asking for help, ensure that all changes in the css are exists in the current version.

        Loading editor
    • The admin said he had bypassed the cache but still saw no change. More specifically, he sent me this message:

      "I applied the change suggested in the thread you linked to, but it doesn't seem to work (at least not on my end). Even when I bypassed my browser's cache it still displayed the original version of the infobox with the redundant switch button. After this I removed the new rule from the Wiki CSS in case it had an undesired effect on anything else."

      The truth is, however, that the changes weren't alive even for 15 minutes, he reverted them back after like 5 minutes. So maybe just waiting for a little longer would help? I will try to tell him and come back if that doesn't work. Thanks for your reply.

        Loading editor
    • MikePrivius#8
      I will try to tell him and come back if that doesn't work

      Fngplg#7
      ensure that all changes in the css are exists in the current version.

      otherwise, it will be too hard to say what was wrong.
        Loading editor
    • Fngplg wrote: ah. those super-fast admins, that can't wait for couple of minutes to update a cache.

      There's no need to be a passive aggressive smartass, I'm working 12h night shifts at the factory and don't have much time for playing around these days.

      If you think you can help, be my guest.

        Loading editor
    • all the help was provided yet. just read the thread.

        Loading editor
    • Well, as far as I can tell, the problem has been fixed. The buttons still appear on mobile version of Wikia, but on PC, everything works just fine. Thank you for your assistance.

        Loading editor
    • there is no custom css/js on the mobile skin, unfortunately. you may send your feedback via special:contact. may be staff will change panel behavior.

        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message
Community content is available under CC-BY-SA unless otherwise noted.