Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic generation of infobox structure #121

Open
TaylanUB opened this issue Apr 22, 2024 · 0 comments
Open

Dynamic generation of infobox structure #121

TaylanUB opened this issue Apr 22, 2024 · 0 comments

Comments

@TaylanUB
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant