Line 27: |
Line 27: |
| | | |
| -->{{#arraydefine:$engl_artisangoods | Artisan Goods }}<!-- | | -->{{#arraydefine:$engl_artisangoods | Artisan Goods }}<!-- |
− |
| |
− | // TODO: finalize how to handle test "does {{{source}}} contain artisan good"?
| |
− | // Primarily need to check whether it's OK that the english test now looks at plural (artisan goods) -- because that's
| |
− | // a term that's already being translated. If necessary, switch some pages to explicitly set is_artisan flag
| |
− | -->{{#arraydefine:$is_artisan|{{#if:{{{is_artisan|}}}
| |
− | | {{#ifeq:{{{is_artisan|}}}|0|{{{is_artisan}}}}}
| |
− | | {{#ifexpr: {{#pos:{{lc:{{{source|}}}}}|{{lc:{{#arrayprint:$lang_artisangoods}}}}|1}} or {{#pos:{{lc:{{{source|}}}}}|{{lc:{{#arrayprint:$engl_artisangoods}}}}|1}} |1}}
| |
− | }}}}<!--
| |
| | | |
| // END of translations | | // END of translations |
− | // Initialize array variables | + | // Initialize variables |
− | -->{{#arraydefine:$image_list|{{{image|}}}, {{{image2|}}}, {{{image3|}}}, {{{image4|}}}|,|unique}}<!--
| |
− | // If no images provided, fill in default names -- but default is different on english wiki than other wikis
| |
− | -->{{#ifexpr:{{#arraysize:$image_list}}<1|{{#arraydefine:$image_list|{{#ifeq:{{CONTENTLANG}}|en|{{PAGENAME}}|{{{eng|}}}}}}}}}<!--
| |
| -->{{#arraydefine:$quality|{{ParseInputQuality|quality={{{quality|}}}|iridium={{{iridium|}}}|hide={{{hide|}}}}}}}<!-- | | -->{{#arraydefine:$quality|{{ParseInputQuality|quality={{{quality|}}}|iridium={{{iridium|}}}|hide={{{hide|}}}}}}}<!-- |
− | -->{{#switch: {{NAMESPACE}} | + | -->{{#arraydefine:$is_artisan|{{#if:{{{is_artisan|}}} |
| + | | {{#ifeq:{{{is_artisan|}}}|0||{{{is_artisan}}}}} |
| + | | {{#ifexpr: {{#if:{{#pos:{{lc:{{{source|}}}}}|{{lc:{{#arrayprint:$lang_artisangoods}}}}}}|1|0}} |
| + | or {{#if:{{#pos:{{lc:{{{source|}}}}}|{{lc:{{#arrayprint:$engl_artisangoods}}}}}}|1|0}} |
| + | |1}} |
| + | }}}}{{#switch: {{NAMESPACE}} |
| |{{ns:User}}|{{ns:User talk}}= | | |{{ns:User}}|{{ns:User talk}}= |
| |#default=<div id="infoboxborder"> | | |#default=<div id="infoboxborder"> |
Line 49: |
Line 43: |
| {{!}}- | | {{!}}- |
| {{!}}colspan="2" style="padding-bottom:5px; text-align: center;"{{!}}<!-- | | {{!}}colspan="2" style="padding-bottom:5px; text-align: center;"{{!}}<!-- |
− | | + | // Display images, using default name if necessary |
− | // Print all images by looping through all entries in $image_list array | + | -->{{Autoimage |
− | -->{{#arrayprint:$image_list||@image@|<!-- | + | |{{{image|}}}, {{{image2|}}}, {{{image3|}}}, {{{image4|}}} |
− | // Add spacing after first image if requested
| + | |eng={{{eng|}}}|separator={{#ifeq:{{{image2spacing|}}}|true|   |{{{image2spacing|}}}}}}}<nowiki/> |
− | -->{{#ifexpr:{{#iferror:{{#expr:{{#arraysearch:@image@}}>0}}|0}} and {{#if:{{{image2spacing|}}}|1|0}} |   }}<!--
| |
− | // If image appears to already have a .png/.gif/.jpg/etc extension (i.e., if 4th-last character is .), don't want to add .png extension
| |
− | -->{{#ifeq:{{#sub:@image@|-4|1}}|.
| |
− | | {{#ifexist:Media:@image@|[[File:@image@]]}} | |
− | | {{#ifexist:Media:@image@_{{uc:{{CONTENTLANG}}}}.png
| |
− | | [[File:@image@_{{uc:{{CONTENTLANG}}}}.png]]
| |
− | | |
− | }}}}}}<nowiki/> | |
| {{!}}- | | {{!}}- |
| {{!}}colspan="2" id="infoboxdetail" style="text-align: center; font-style: italic;" {{!}} {{#if:{{{description|}}}|{{{description|}}}|{{Description|{{PAGENAME}}}}}} | | {{!}}colspan="2" id="infoboxdetail" style="text-align: center; font-style: italic;" {{!}} {{#if:{{{description|}}}|{{{description|}}}|{{Description|{{PAGENAME}}}}}} |
Line 110: |
Line 96: |
| {{!}} id="infoboxdetail" {{!}} {{Edibility |{{{edibility|}}} |quality={{#arrayprint:$quality}}}} | | {{!}} id="infoboxdetail" {{!}} {{Edibility |{{{edibility|}}} |quality={{#arrayprint:$quality}}}} |
| }}}}<!-- | | }}}}<!-- |
| + | |
| + | // custom_price if defined provides entire text of all price-related sections |
| + | -->{{#if:{{{custom_price|}}} |
| + | |{{{custom_price}}}<!-- |
| | | |
| // Display all item prices: Base price plus all professions listed in {{{profession}}} | | // Display all item prices: Base price plus all professions listed in {{{profession}}} |
| // Subtemplate automatically decides how to handle multiple columns, etc. | | // Subtemplate automatically decides how to handle multiple columns, etc. |
− | -->{{#arraydefine:$sellprices|{{{sellprice|}}}}}<!-- | + | --> |{{Infosection price |
− | -->{{Infosection price
| + | | prof = Base {{#if:{{{profession|}}} |, {{{profession|}}}}} |
− | | profession = Base {{#if:{{{profession|}}} |, {{{profession|}}}}}
| + | | item = {{{eng|{{{name|{{{PAGENAME}}}}}}}}} |
− | | sellitem = {{#ifexpr: {{#arraysize:$image_list}}>1 and {{#iferror:{{#arraysize:$sellprices}}|0}}={{#arraysize:$image_list}}
| + | | link = {{{name|{{{PAGENAME}}}}}} |
− | | {{#arrayprint:$image_list}}
| + | | price = {{{sellprice|}}} |
− | | {{{eng|{{{name|{{PAGENAME}}}}}}}}}}
| + | | quality = {{#arrayprint:$quality}} |
− | | alt_sellitem = {{{name|{{PAGENAME}}}}}
| + | }}<!-- |
− | | sellprice = {{{sellprice|}}}
| |
− | | quality = {{#arrayprint:$quality}}
| |
− | }}<!-- | |
| | | |
| // Add display of products and their prices. | | // Add display of products and their prices. |
− | // artisanitem is new parameter, that eventually should be able to move alot of the single-item-case data | + | // artisan_item is new parameter, that eventually should be able to move alot of the single-item-case data |
| // onto the individual article pags. | | // onto the individual article pags. |
− | // If artisanitem provided, use it to generate the infosection. Otherwise, fallback to old-style manual switch | + | // If artisan_item provided, use it to generate the infosection. Otherwise, fallback to old-style manual switch |
− | -->{{#if:{{{artisanitem|}}} | + | --> {{#if:{{{artisan_item|}}} |
− | | {{Infosection price
| + | | {{Infosection price |
− | | profession = {{#if:{{{artisanprofession|}}}| {{{artisanprofession}}} | Base,Artisan}}
| + | | item = {{{artisan_item}}} |
− | | artisan = true
| + | | prof = {{#if:{{{artisan_prof|}}}| {{{artisan_prof}}} | Base,Artisan}} |
− | | sourceprice = {{{sellprice|}}}
| + | | artisan = true |
− | | sellitem = {{{artisanitem}}}
| + | | link = {{{artisan_link|}}} |
− | | alt_sellitem = {{{alt_artisanitem|}}}
| + | | price = {{{artisan_price|0}}} |
− | | sellprice = {{{artisanprice|}}}
| + | | quality = {{{artisan_qual|}}} |
− | | sellimage = {{{artisanimage|}}}
| + | | srcprice = {{{sellprice|}}} |
− | | quality = {{{artisanquality|}}}
| + | | auto = true |
− | | oneitempercol = {{{artisanoneitempercol|}}}
| + | }}<!-- |
− | | ncolumns = {{{artisancolumns|}}}
| |
− | }}<!--
| |
| | | |
− | // Manually define various artisanitem sections | + | // Manually define various artisan_item sections |
| // One key reason to move these details onto the individual infobox pages is for sake of translation -- so that language-specific | | // One key reason to move these details onto the individual infobox pages is for sake of translation -- so that language-specific |
− | // translations of sellitem can be provided outside of template namespace. | + | // translations of item can be provided outside of template namespace. |
| // (Infosection price will recognize some key item names, such as Wine, Juice, Jelly, Pickles, but doing more than that is insane) | | // (Infosection price will recognize some key item names, such as Wine, Juice, Jelly, Pickles, but doing more than that is insane) |
| --> | | --> |
− | | {{#switch:{{lc:{{{type|{{{eng|{{PAGENAME}}}}}}}}}}
| + | | {{#switch:{{lc:{{{type|{{{eng|{{{name|{{PAGENAME}}}}}}}}}}}}} |
− | |sunflower = {{Infosection price|profession=base|artisan=true|sourceprice={{{sellprice|}}}|sellitem=Oil |sellprice=100 |quality=normal}} | + | |sunflower = {{Infosection price|prof=base |artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Oil |price=100 |quality=normal}} |
− | |hops = {{Infosection price|profession=base,artisan|artisan=true|sourceprice={{{sellprice|}}}|sellitem=Pale Ale,Pickles |sellprice=300,}} | + | |hops = {{Infosection price|prof=base,artisan|artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Pale Ale,Pickles |price=300}} |
− | |wheat = {{Infosection price|profession=base,artisan|artisan=true|sourceprice={{{sellprice|}}}|sellitem=Beer,Pickles |sellprice=200,}} | + | |wheat = {{Infosection price|prof=base,artisan|artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Beer,Pickles |price=200}} |
− | |honey = {{Infosection price|profession=base,artisan|artisan=true|sourceprice={{{sellprice|}}}|sellitem=Mead |sellprice=200 |iridium=true}} | + | |honey = {{Infosection price|prof=base,artisan|artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Mead |price=200 |iridium=true}} |
− | |corn = {{Infosection price|profession=base,artisan|artisan=true|sourceprice={{{sellprice|}}}|sellitem=Juice,Pickles,Oil|sellprice=,,100|quality=normal}} | + | |corn = {{Infosection price|prof=base,artisan|artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Juice,Pickles,Oil|price=100 |quality=normal}} |
− | |tea leaves={{Infosection price|profession=base,artisan|artisan=true|sourceprice={{{sellprice|}}}|sellitem=Green Tea,Pickles|sellprice=100, |quality=normal}} | + | |tea leaves= {{Infosection price|prof=base,artisan|artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Green Tea,Pickles|price=100 |quality=normal}} |
| |fruit | | |fruit |
− | |fruits = {{Infosection price|profession=base,artisan|artisan=true|sourceprice={{{sellprice|}}}|sellitem=Wine,Jelly | iridium=true}} | + | |fruits = {{Infosection price|prof=base,artisan|artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Wine,Jelly |price=0 |iridium=true}} |
| |vegetables | | |vegetables |
− | |vegetable = {{Infosection price|profession=base,artisan|artisan=true|sourceprice={{{sellprice|}}}|sellitem=Juice,Pickles | iridium=true}} | + | |vegetable = {{Infosection price|prof=base,artisan|artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Juice,Pickles |price=0 |iridium=true}} |
− | |truffle = {{Infosection price|profession=base,artisan|artisan=true|sourceprice={{{sellprice|}}}|sellitem=Truffle Oil|sellprice=1065|quality=normal}} | + | |truffle = {{Infosection price|prof=base,artisan|artisan=true|item=Truffle Oil |price=1065|quality=normal}} |
− | |milk = {{Infosection price|profession=base,rancher,artisan|artisan=true|sellitem=Cheese |sellprice=230|iridium=true}} | + | |milk = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Cheese |price=230|iridium=true}} |
− | |large milk= {{Infosection price|profession=base,rancher,artisan|artisan=true|sellitem=Cheese |sellprice=230|iridium=true|hide=normal,silver}} | + | |large milk= {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Cheese |price=230|quality=gold,iridium}} |
− | |goat milk = {{Infosection price|profession=base,rancher,artisan|artisan=true|sellitem=Goat Cheese |sellprice=400|iridium=true}} | + | |goat milk = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Goat Cheese |price=400|iridium=true}} |
− | |large goat milk = {{Infosection price|profession=base,rancher,artisan|artisan=true|sellitem=Goat Cheese |sellprice=400|iridium=true|hide=normal,silver}} | + | |large goat milk = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Goat Cheese |price=400|quality=gold,iridium}} |
− | |wool = {{Infosection price|profession=base,rancher,artisan|artisan=true|sellitem=Cloth |sellprice=470|quality=normal}} | + | |wool = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Cloth |price=470|quality=normal}} |
− | |duck egg = {{Infosection price|profession=base,rancher,artisan|artisan=true|sellitem=Duck Mayonnaise |sellprice=375|quality=normal}} | + | |duck egg = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Duck Mayonnaise |price=375|quality=normal}} |
− | |egg = {{Infosection price|profession=base,rancher,artisan|artisan=true|sellitem=Mayonnaise |sellprice=190|quality=normal}} | + | |egg = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Mayonnaise |price=190|quality=normal}} |
− | |dinosaur egg= {{Infosection price|profession=base,rancher,artisan|artisan=true|sellitem=Dinosaur Mayonnaise |sellprice=800|quality=normal}} | + | |dinosaur egg= {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Dinosaur Mayonnaise |price=800|quality=normal}} |
− | |large egg = {{Infosection price|profession=base,rancher,artisan|artisan=true|sellitem=Mayonnaise |sellprice=190|hide=normal,silver}} | + | |large egg = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Mayonnaise |price=190|quality=gold}} |
− | |void egg = {{Infosection price|profession=base,rancher,artisan|artisan=true|sellitem=Void Mayonnaise |sellprice=275|quality=normal}}<!-- | + | |void egg = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Void Mayonnaise |price=275|quality=normal}}<!-- |
| | | |
| // Add artisan sections to generic item pages. Again, shouldn't be necessary any more once profession is added to original article | | // Add artisan sections to generic item pages. Again, shouldn't be necessary any more once profession is added to original article |
| --> | | --> |
| |wine | | |wine |
− | |juice = {{#if:{{{profession|}}}||{{Infosection price|profession=artisan|sellitem={{{name|{{PAGENAME}}}}}|sellprice={{{sellprice|}}}|quality=normal}}}} | + | |juice = {{#if:{{{profession|}}}||{{Infosection price|prof=artisan|item={{{name|{{{{PAGENAME}}}}}}}|price={{{sellprice|}}}|quality=normal}}}} |
− | |aged roe = {{#if:{{{profession|}}}||{{Infosection price|profession=artisan|sellitem={{{name|{{PAGENAME}}}}}|sellprice={{{sellprice|}}}|quality=normal}} | + | |aged roe = {{#if:{{{profession|}}}||{{Infosection price|prof=artisan|item={{{name|{{{{PAGENAME}}}}}}}|price={{{sellprice|}}}|quality=normal}}}} |
| }}}}}}{{#if:{{{ingredients|}}}|<nowiki/> | | }}}}}}{{#if:{{{ingredients|}}}|<nowiki/> |
| {{!}}- | | {{!}}- |