Template documentation (for the above template, sometimes hidden or invisible)

Usage

This template makes use of the DynamicPageList extension (full manual). It serves to provide simpler access to the use of a particular DPL tag, which can be viewed in the template's source code. By looking at the page infobox in the specified category, it generates a table with four parameters: each effect of the ingredient and a list of ingredients that have the specified effect.

The template uses first dpl call to define the vars for the table, which are the four alchemical effects. Then, just as in the {{SkyrimIngredients}} template, the links in the table's headers are generated using the {{exists}} template. The ingredients' lists are generated by a second dpl call, which is stored in the {{EffectsbyIngredientDPL/Cells}} sub-template to prevent a template loop.

{{EffectsbyIngredientDPL}}

Lists

{{EffectsbyIngredientDPL/Cells|{{#if:{{#var:effect1}}|{{exists|{{#var:effect1}} (Skyrim)|then={{#var:effect1}} (Skyrim)|else={{#var:effect1}}}}}}|effect1={{#var:effect1}}|effect2={{#var:effect2}}|effect3={{#var:effect3}}|effect4={{#var:effect4}}|title={{{title|{{#replace:{{PAGENAME}}|'|'}}}}}}}
  • The first variable is for the sub-template to only include the ingredients in the list that is linked from the specified effect.
  • effect1 – first specified effect.
  • effect2 – second specified effect.
  • eefect3 – third specified effect.
  • eefect4 – fourth specified effect.
  • title – article's name generated by the {{PAGENAME}} magic word and any single apostrophe HTML symbols replaced by the actual symbol.

EffectsbyIngredientDPL/Cells

The second dpl call is used to generate a list of ingredients that has the specified effect. Then it includes the "Appearances" section and all four effect parameters from the infobox.

²{#dplreplace:²{#dplreplace:²{#dplreplace:²{#dplreplace:,¦((?s).*?)(V:\sDragonborn)((?s).*)¦²{DR}²}²¦((?s).*?)(V:\sSkyrim)((?s).*)¦}²¦((?s).*?)(V:\sHearthfire)((?s).*)¦²{HF}²}²¦((?s).*?)(V:\sDawnguard)((?s).*)¦²{DG}²}² 
  • The "Appearances" section is replaced with the {{DG}}, {{DR}}, or {{HF}} templates depending on the regular expression matches.
²{#dplreplace:²{#dplreplace:²{#dplreplace:²{#dplreplace:²{#dplreplace:²{#dplreplace:²{#dplreplace:1,1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,1¦(1{{{effect1}}}1)¦†}²¦(1{{{effect2}}}1)¦†}²¦(1{{{effect3}}}1)¦†}²¦(1{{{effect4}}}1)¦†}²¦([^†])¦}²¦(†)(?!\1+)¦}²¦(†)+¦$1}²,
  • The four effect parameters from the infobox are searched to determine the specified effects and replaced with the symbol. Then every other effect is removed. After that, a single symbol is removed too. Lastly, any duplicate symbol is replaced with a single one. Everything is done with regular expression matches.

Example

{{EffectsbyIngredientDPL}} code on the Mora Tapinella article.

Restore Magicka Lingering Damage Health Regenerate Stamina Fortify Illusion

† Multiple effects

This code will generate a table based on the "Mora Tapinella" article's four effects. The article must be in one of the following categories: Category:Skyrim: Ingredients, Category:Dawnguard: Ingredients, or Category:Dragonborn: Ingredients.


*Disclosure: Some of the links above are affiliate links, meaning, at no additional cost to you, Fandom will earn a commission if you click through and make a purchase. Community content is available under CC-BY-SA unless otherwise noted.