FANDOM

A FANDOM user
  Loading editor
  • Hi, another question I could not find an answer to. As an example I will use the champion page of Ant-Man. In the infobox you can see several tags for this champion displayed vertical. I have the idea to automatically create Categories for each tag inputted in the infobox, but how to accomplish that?

    - So the input now is: |tags = Avengers
    Civil War - Cpt. America
    Defensive: Tank
    Hero
    Metal
    Size: M

    - My idea is to use a comma separated string: |tags = Avengers,Civil War - Cpt. America,Defensive: Tank,Hero,Metal,Size: M

    - In the infobox there should be logic to split the string and create a category for each item. The string function #explode, comes close, but does not iterate each item. Each item should make a category: [[Category:{{{tag}}}]]

    - The infobox should still display each item as a list.

      Loading editor
    • It can be done, but the coding is tricky for an arbitrary list. I would like to see some of those tags become their own parameters in the infobox. Things like Hero/Villain, Size, and Offense/Defense/Control could each be separated out from the list and made a parameter. (You can still display them as a list, if you want, but inside the template they would be different fields.) Reducing the size of the list makes category generation much easier.

      The next step is deciding what you want to call the categories so they make sense but do not use any special characters if possible, like a colon. The category could be "Tank" and not "Defensive: Tank" for example. (The Offensive/Defensive part seems redundant and unnecessary, unless there are special cases I'm not aware of.)

      Having separate parameters also lets you easily generate more lists with DPL.

        Loading editor
    • ​​​​​After I've posted the question I saw that the categories already exist. The category "Defensive: Tank" is how it is displayed in the game, same as Size M, Size XL etc. I'm not an expert on tags, but it probably has meaning and I would like to keep the same style as the game, but perhaps thats not the best way to do this.

      If you look at the code of the page of Electro you can see that there used to be an idea to place each tag as:

      |tag1 = Offensive: Burst
      |tag2 = Villain
      |tag3 = Sinister Six
      |tag4 = Thunderbolts

      Using your suggestion a category can be made of each tag. But the problem here is that if new tags get added to Electro, there should also be a |tag5 (etc etc), and you again need to update the infobox template. I was trying to make this easier. Any thoughts?

        Loading editor
    • I see the Defensive: Tank category, but nothing for Size. Almost all the subcategories in Category:Champion Tags are empty and it's fairly easy to rename a category if necessary. I think the tags would be much more useful if they were broken down into individual parameters. Here's what I have so far for parameters and possible values from which we can generate categories:

      • Alignment: Hero, Villain, Mercenary
      • Offensive: Burst, Damage Over Time, Raw Damage
      • Defensive: Guard, Tank, Utility
      • Size: S, M, L, XL
      • Teams: A-Force, Avengers, etc (See List of Champions by Team)
      • Attributes: Metal, Robot, Sword-Wielder

      Of these, I think only Teams and Attributes need to be comma-separated lists, the rest have only one value per character. This would make generating categories much easier (teams would be the big one, we just need to plan for the maximum number of teams a character can be on) but it would require some work on the infobox template and then updating every page that uses it. Looks like this needs to be done anyway, given your Electro example, but once it is done, all those empty categories will be automatically populated.

        Loading editor
    • A FANDOM user
        Loading editor
  • So about renaming images:

    • Adaptiod (Super Adaptoid Hydra) portrait -> Adaptoid (Super Adaptoid Hydra) portrait
    • Captain Marvel portrait - > Captain Marvel (Classic) portrait
    • Captain Marvel featured- > Captain Marvel (Classic) featured
    • Captain Marvel (MCU 2019) portrait -> Captain Marvel portrait
    • Captain Marvel (MCU 2019) featured -> Captain Marvel featured
    • Havok features -> Havok featured
    • Punisher (2099) portrait -> Punisher 2099 portrait
    • Punisher (2099) featured -> Punisher 2099 featured
    • 72B5A3EE903A159C750D9ABB5D9293E5F61D82F1.png -> Thanos (Infinity Gauntlet) portrait
    • Old Human Torch portrait -> Human Torch (Old) portrait

    For the most part, changing these names will result in broken images on certain pages (not quite sure if renaming images will update the pages as well), but only for the Captain Marvel changes this will be an issue.

      Loading editor
    • View all 7 replies
    • Yes, that's the idea. I've created the current table on that page, which was a replacement of the blackish templated/table. It is based on feedback of some of the users, and for now manually created. This DPL table is (almost) an exact copy of that table. So I think this will be accepted.

      Otherwise this was a great learning exercise how to use the DPL :)

      I'm also thinking of other ways to use this DPL, as there are more list currently being manually updated when a new page is being added. In what we've created we are using either the %PAGE% or infobox parameters. Say for example I would like a column with the Bio (information that exist on the page), how would you retrieve that information in the DPL syntax?

        Loading editor
    • You can get a section of a page by prefacing the heading with "#" like this:

      <dpl>
      title   = Punisher
      include = #Bio
      </dpl>

      Returns:

      I know what you're thinking. How did I end up like this? Tied to a chair in a dingy warehouse, with a big, scary man pointing a big, scary gun in my face. Well let me tell you: you're here because you're a criminal. You're a tumor of society. And me? I'm just a man who loves his job. I'm the Punisher. And we're about to have a lot of fun together...

        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.