Skip to content

Dynamic generation of infobox structure #121

@TaylanUB

Description

@TaylanUB

Is there a way to generate the infobox structure dynamically? For example, using Wikitext parser functions to generate the XML that specifies the infobox structure? Or maybe a Lua API of sorts?

Pseudo-code for example purposes; I know this doesn't work:

<infobox>
  <panel>

    <section>
      <label>First section</label>
      ...
    </section>

    {{#if: {{{has section 2|}}} | <!-- Conditionally add a second section to the panel. -->

    <section>
      <label>Second section</label>
      ...
    </section>

    }}

  </panel>
</infobox>

The reason I wish to have something like this:

I'm building an infobox for creatures in a video game. The "statistics" part of the infobox may contain multiple tabs per difficulty setting of the game, if the creature's stats change depending on difficulty. There's four difficulty options one can choose from, and it's annoying when the infobox lists four tabs with identical contents for some trivial creatures that always have the same stats.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions