FANDOM


  • Hello !

    Is there a way to obtain the plateform on which the user is ? Like a magicword or a specific module/function in Lua ?

    Have a good day !

      Loading editor
    • What do you mean by "platform"?

        Loading editor
    • If a user is on smartphone or a computer

        Loading editor
    • Device, not platform.

      There are responsive elements, but those are inside Fandom's code. There's no magic word for it; that's not how magic words work. What do you want to use it for?

        Loading editor
    • ahahah mixing my french and english words together. So yeah device. I would like to be able to remove some elements from a page when it is viewed by smartphone users as it isn't an element viewable on a small screen (table in table in table).

        Loading editor
    • You could do something like this:

      @media only screen and (max-width: 700px) {
        something {
          display: none;
        }
      }
        Loading editor
    • This could work but I would like to avoid using css for that. Ideally a lua function would be perfect to be able to use it within modules or the parser.

      I will keep this in mind if I do not find something else :)

        Loading editor
    • Nested tables are best avoided even on desktop views.

      The easiest and kinda cheatiest way would be to put the hidden content in a template and give that template the Notice or Navigation type. Those aren't parsed on mobile.

        Loading editor
    • To answer your question, no. There is not way to do this using Lua or magic words. MediaWiki simply does not provide such methods.

      When someone views the website on their mobile device using a web browser, there are two ways they can be viewing it: the mobile layout and the desktop layout. Fandom's mobile layout hides certain things. When it comes to templates, it will hide the template depending on the template's designated type. For example, an infobox is not hidden while a notice template is hidden. You can read more about the different template types here. Another way to hide things in the mobile layout is to add the class "hidden" to it. If you are using wikitext that does not permit the specification of a class, then you need to wrap that portion in something that does such as a div tag. Then assign the class to the wrapper. The method that Parkour2906 proposed applies when users are viewing the wiki on their mobile device using the desktop layout. When in desktop layout, you could also use JS for this but that would be an overkill as CSS is sufficient.

        Loading editor
    • The best way is to use the template type Andrewds has mentioned that only hides stuff on the mobile skin. Mobile users may sometimes opt for the desktop skin, by tapping on the button "VIEW FULL SITE" on the bottom of the page. If you have used the CSS selector based on screen width to hide things, some of them may remain hidden. And it can be annoying if they realise some information remains hidden even after tapping a button that promisses to deliver "the full site".

      So just create a template container and set its type to "Notice". Then you can use around things you want to hide on mobile skin.

      For example, on the bottom of the section "Tinctures" you have a sentence reading: "For yada yada, see this article on desktop version." Boom, link to the desktop version. This will make your users free to choose. Most people will see it and ignore the link, they're satisfied with the content already displayed on the mobile skin. But some nerds will want more. The desktop link is there to support them.

        Loading editor
    • Thanks a lot for the different solutions and usefull insights !

        Loading editor
    • I would just like to clarify for the record that is was Tupka217 that originally mentioned the template method. The purpose of my post was to clarify in which cases each of the methods (Tupka217's versus Parkour2906's) would be used.

        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.