Automatically Fetch Current HTML/TWIG Templates for All Articles Types | World Anvil

Remove these ads. Join the Worldbuilders Guild

Automatically Fetch Current HTML/TWIG Templates for All Articles Types

User Interface (UI) / User Experience (UX) · Articles & templates · Created by Rozarik
closed
custom article template templates articles twig html studio variable variables section sections subsection subsections customize customizable

What functionality is missing? What is unsatisfying with the current situation?


  When creating a custom article template, the Studio provides access to the following GitHub repo that contains a list of HTML/Twig templates.
 

The problem with these templates is that they haven't been updated in over 2 years and are considerably outdated. For example, the character/person template is missing a large amount of twig variables that the current default character/person articles have (which isn't too surprising as they have experienced a lot of updates since the GitHub repo was last updated).

However, aside from the fact that these HTML/Twig templates will continue to grow more incongruent with concurrent functionality the longer they go without being updated, there is the even larger issue that users are left to scavange for unaccoutned for variables through trial-and-error. Which, ultimately, impacts the custom article creation process very negatively due to the fact that any attempts to manipulate or customize current article variables is almost solely dependent on tribal knowledge.

That said, if there was a way to dynamically pull all of an article's twig variables from within an article's twig, such as like this, then that would be great:

<ol>
  for key, value in _context 
  <li> key </li>
  endfor 
</ol>


Unfortunately though, this doesn't pull any of the internal variables that are associated with the sections of an article, such as variables like "article.age" (in the case of an character/person article. Alongside that, the twig "dump" command also causes the page to crash when it is used, so it's not possible to gather variables through that method either.

 

How does this feature request address the current situation?


The solution I have in mind is simple in theory (I hope), but like any implementation, it will incur some degree of a change in the development process/workflow.

My idea/approach is to have the GitHub repo that hosts these HTML/Twig templates automatically pull/fetch the most version of them.
  • This comes with the assumption that the current native HTML/Twig templates that are used by World Anvil are stored in another repo somewhere such that they can be retrieved by the repo that hosts the templates for users looking to customize their world.


What are other uses for this feature request?


In the end, assuming this is possible and fulfilled, by having an automatically updated repo of article HTML/Twig templates, any new changes and implementations that are made to any of the standard article templates will automatically be picked up by the repo - preventing the need to update them manually. Not only that, but both expert users, as well as new users who are learning how to customize their World Anvil projects, will be much better supported in their endeavors. And, because of that, by having a reliable source of truth that is automatically kept up-to-date, it would naturally encourage the growth of a more vibrant, active, and knowledable community.

Altogether, and in conclusion, I believe this feature/functionality would prove to be extremely valuable for the future longevity and quality of World Anvil. And I genuinely hope that such a request isn't too large an ask!


Sincerely,
Rozarik

Follow up


The link to the repo that I referenced in the beginning was automatically removed when submitted the request. Going to try pasting it here (I'll separate the ".com" portion - hopefully that wil prevent it from being removed).   Dimitris' HTML/Twig Article Template Repo: github .com/iamromeo/worldanvil-templates/tree/master/article-templates/base-template
Current score

7/300 Votes · +1701 points

Votes Cast

  • +1

    by JibstaMan
    on 2022-08-16 15:30
    Totally agree. For those not in the Discord, the link/zip within Studio has just been updated today: "The World Anvil Custom Templates TWIG files have been updated. Now featuring the new system and all prompts / features added the last year"
  • +100

    by stormtroll
    on 2022-08-16 15:28
  • +100

    by ss2020
    on 2022-08-16 02:17
  • +300

    by Buzzard
    on 2022-08-15 21:21
    This would make custom templates way more useable.
  • +300

    by JoellaKay
    on 2022-08-15 20:37
    This would be so helpful and the developers wouldn't have to keep the zip file up-to-date. (It's very out-of-date right now.)
  • +300

    by spartango
    on 2022-08-15 20:32
    This was the initial reason I gave up trying to work with custom article templates. I also thought it was weird how statblocks could dynamically provide their boilerplate TWIG, but article templates only gave a static github repo.
  • +300

    by SoulLink
    on 2022-08-15 20:24
  • +300

    by Rozarik
    on 2022-08-15 20:03