Template:RecipeList: Difference between revisions
imported>Aramachus Created page with "<onlyinclude><includeonly> {{#dpl: |category={{{craft}}}/{{{rank}}} |notcategory={{{craft}}}/Subcraft |notcategory={{{craft}}}/Desynthesis |notcategory=High Quality |include={Synthesis Recipe¦RecipeList.dpl},##Horizon Changes {{changes}} |table=class="horizon-table {{#if:{{{colorclass|}}}|{{{colorclass}}}|{{lc:{{{craft}}}}}-table}} center-col-2 center-col-3 sortable",-,Item,Cap,Crystal,class="unsortable"{{!}}Ingredients,class="unsortable"{{!}}HQ,Horizon Changes {{Change..." |
imported>Aramachus removed the notcategory desynth, added some comments and minor improvements and added a bit of documentation |
||
| Line 2: | Line 2: | ||
{{#dpl: |
{{#dpl: |
||
|category={{{craft}}}/{{{rank}}} |
|category={{{craft}}}/{{{rank}}} |
||
|notcategory={{{craft}}}/Subcraft <!-- Assumes that item pages, which are categorized as subcraft wrt a certain craft, NEVER contain recipes where that craft is the main craft --> |
|||
|notcategory={{{craft}}}/Subcraft |
|||
<!--|notcategory={{{craft}}}/Desynthesis --> <!-- this does NOT work because if there is a desynth recipe on a page, the entire page is categorized as desynth and excluded here --> |
|||
|notcategory={{{craft}}}/Desynthesis |
|||
|notcategory=High Quality |
|notcategory=High Quality <!-- HQ pages are covered by their NQ pages --> |
||
|include={Synthesis Recipe¦RecipeList.dpl},##Horizon Changes |
|include={Synthesis Recipe¦RecipeList.dpl},##Horizon Changes.* |
||
|table=class="horizon-table {{#if:{{{colorclass|}}}|{{{colorclass}}}|{{lc:{{{craft}}}}}-table}} center-col-2 center-col-3 sortable",-,Item,Cap,Crystal,class="unsortable"{{!}}Ingredients,class="unsortable"{{!}}HQ,Horizon Changes {{Changes}} |
|table=class="horizon-table {{#if:{{{colorclass|}}}|{{{colorclass}}}|{{lc:{{{craft}}}}}-table}} center-col-2 center-col-3 sortable",-,Item,Cap,Crystal,class="unsortable"{{!}}Ingredients,class="unsortable"{{!}}HQ,Horizon Changes {{Changes}} |
||
|tablesortcol=3<!-- need to use +1 here because the additional linebreak at the beginning of the phantom template that is used to apply classes and styles to the rows somehow counts as a column here --> |
|tablesortcol=3<!-- need to use +1 here because the additional linebreak at the beginning of the phantom template that is used to apply classes and styles to the rows somehow counts as a column here --> |
||
}} |
}} |
||
</includeonly></onlyinclude> |
</includeonly></onlyinclude> |
||
==Usage== |
|||
Template that generates a dpl table for a given craft for a given rank. |
|||
Parameters |
|||
*''craft'': craft for which the table is to be generated |
|||
*''rank'': which rank is supposed to be displayed |
|||
*''colorclass'' (''optional''): by default, the table uses the coloring theme of the craft. If another coloring is desired, use this class. |
|||
===Example=== |
|||
<pre>{{RecipeList|craft=Alchemy|rank=Apprentice}} |
|||
</pre> |
|||
{{RecipeList|craft=Alchemy|rank=Apprentice}} |
{{RecipeList|craft=Alchemy|rank=Apprentice}} |
||
Revision as of 11:16, 30 October 2024
Usage
Template that generates a dpl table for a given craft for a given rank.
Parameters
- craft: craft for which the table is to be generated
- rank: which rank is supposed to be displayed
- colorclass (optional): by default, the table uses the coloring theme of the craft. If another coloring is desired, use this class.
Example
{{RecipeList|craft=Alchemy|rank=Apprentice}}
Extension:DynamicPageList4 (DPL4), version 4.0.0: Error: MediaWiki\Extension\DynamicPageList4\Query::buildAndSelect - Template:RecipeList: The DynamicPageList4 extension (version 4.0.0) produced a SQL statement which led to a Database error.<br/>The reason may be an internal error of DynamicPageList4 or an error that you made; especially when using parameters like 'categoryregexp' or 'titleregexp'. Usage of non-greedy <code>*?</code> matching patterns are not supported.<br/>The error message was:<br/><code>Error 1054: Unknown column 'ecl1.cl_to' in 'WHERE' Function: MediaWiki\Extension\DynamicPageList4\Query::buildAndSelect - Template:RecipeList Query: SET STATEMENT max_statement_time=10 FOR SELECT DISTINCT p.page_namespace AS `page_namespace`,p.page_id AS `page_id`,p.page_title AS `page_title` FROM `page` `p` JOIN `categorylinks` `cl1` ON (((p.page_id = cl1.cl_from) AND (cl1.cl_to = 'Alchemy/Apprentice'))) LEFT JOIN `categorylinks` `ecl1` ON (((p.page_id = ecl1.cl_from) AND (ecl1.cl_to = 'Alchemy/Subcraft'))) LEFT JOIN `categorylinks` `ecl2` ON (((p.page_id = ecl2.cl_from) AND (ecl2.cl_to = 'High_Quality'))) WHERE p.page_is_redirect = 0 AND ecl1.cl_to IS NULL AND ecl2.cl_to IS NULL LIMIT 500 </code>