Difference between revisions of "Template:NHFurnitureVillagers"

From Nookipedia, the Animal Crossing wiki
m (moving to switch function to also stop Cafe from duplicating Poki prices (currently in the process of adding the Poki prices to the Cafe items))
(adding parameter to prune HHP results)
Line 1: Line 1:
{{#vardefine: result-nh | {{#cargo_query: table=nh_house|fields=CONCAT( '[[File:', nh_house.villager, ' NH Villager Icon.png|25px|link=|alt=|', nh_house.villager, ']] [[', nh_house._pageTitle, '|', nh_house.villager, ']]' )|where=nh_house.items LIKE '%"{{#replace:{{{item|{{#replace:{{#titleparts:{{PAGENAME}}||-1}}|<nowiki/> <nowiki/>(New Horizons)|}}}}}|'|\'}}"%'|limit=300|order by=nh_house.name_sort|default=}}}}{{#vardefine: result-hhp | {{#cargo_query: table=hhp_villager|fields=CONCAT( '[[File:', hhp_villager.name, ' NH Villager Icon.png|25px|link=|alt=|', hhp_villager.name, ']] [[', hhp_villager._pageTitle, '|', hhp_villager.name, ']]' )|where=hhp_villager.unlocked_items LIKE '%"{{#replace:{{{item|{{#replace:{{#titleparts:{{PAGENAME}}||-1}}|<nowiki/> <nowiki/>(New Horizons)|}}}}}|'|\'}}"%'|limit=300|order by=hhp_villager.name_sort|default=}}}}{{#vardefine: required | {{#cargo_query: table=hhp_villager|fields=CONCAT( '[[File:', hhp_villager.name, ' NH Villager Icon.png|25px|link=|alt=|', hhp_villager.name, ']] [[', hhp_villager._pageTitle, '|', hhp_villager.name, ']]' )|where=hhp_villager.item1 = "{{#replace:{{{item|{{#replace:{{#titleparts:{{PAGENAME}}||-1}}|<nowiki/> <nowiki/>(New Horizons)|}}}}}|'|\'}}" OR hhp_villager.item2 = "{{#replace:{{{item|{{#replace:{{#titleparts:{{PAGENAME}}||-1}}|<nowiki/> <nowiki/>(New Horizons)|}}}}}|'|\'}}" OR hhp_villager.item3 = "{{#replace:{{{item|{{#replace:{{#titleparts:{{PAGENAME}}||-1}}|<nowiki/> <nowiki/>(New Horizons)|}}}}}|'|\'}}"|limit=300|order by=hhp_villager.name_sort|default=}}}}{{#vardefine:wardell|{{#cargo_query: table=nh_furniture|fields=nh_furniture.buy2_price|where=nh_furniture.en_name = "{{#replace:{{{item|{{#replace:{{#titleparts:{{PAGENAME}}||-1}}|<nowiki/> <nowiki/>(New Horizons)|}}}}}|'|\'}}"|limit=2000|default=|no html}}}}{{#vardefine:paradise|{{#cargo_query: table=nh_furniture|fields=nh_furniture.availability2|where=nh_furniture.en_name = "{{#replace:{{{item|{{#replace:{{#titleparts:{{PAGENAME}}||-1}}|<nowiki/> <nowiki/>(New Horizons)|}}}}}|'|\'}}"|limit=2000|default=|no html}}}}{{#if: {{#var: result-nh}}|This item appears in the homes of the following villagers: {{#var: result-nh}}.|No villagers have this item in their home.}} {{#if: {{#var: result-hhp}}|In {{HHP|short}}, this item is unlocked for usage in house designing when doing a vacation home request for the following villagers: {{#var: result-hhp}}.{{#if: {{#var: required}}|&#32;The item is also required to be used in the vacation homes of the following villagers: {{#var: required}}.}}{{#if: {{#var: wardell}}|&#32;After unlocking this item, the item can be purchased from [[Wardell]]'s catalog{{#switch:{{#var:paradise}}|Paradise Planning office|Café=|#default=&#32;for {{Currency|Poki|{{#var:wardell}}}}}}.}}|In {{HHP|short}}, no villagers unlock this item for usage in designing a vacation home, and it can only be used once the player's [[catalog]] is unlocked after completing the 25th vacation home.}}<noinclude>{{clear}}<br>{{Documentation}}[[Category:Cargo templates]]</noinclude>
+
{{#vardefine: result-nh | {{#cargo_query: table=nh_house|fields=CONCAT( '[[File:', nh_house.villager, ' NH Villager Icon.png|25px|link=|alt=|', nh_house.villager, ']] [[', nh_house._pageTitle, '|', nh_house.villager, ']]' )|where=nh_house.items LIKE '%"{{#replace:{{{item|{{#replace:{{#titleparts:{{PAGENAME}}||-1}}|<nowiki/> <nowiki/>(New Horizons)|}}}}}|'|\'}}"%'|limit=300|order by=nh_house.name_sort|default=}}}}{{#vardefine: result-hhp | {{#cargo_query: table=hhp_villager|fields=CONCAT( '[[File:', hhp_villager.name, ' NH Villager Icon.png|25px|link=|alt=|', hhp_villager.name, ']] [[', hhp_villager._pageTitle, '|', hhp_villager.name, ']]' )|where=hhp_villager.unlocked_items LIKE '%"{{#replace:{{{item|{{#replace:{{#titleparts:{{PAGENAME}}||-1}}|<nowiki/> <nowiki/>(New Horizons)|}}}}}|'|\'}}"%'|limit=300|order by=hhp_villager.name_sort|default=}}}}{{#vardefine: required | {{#cargo_query: table=hhp_villager|fields=CONCAT( '[[File:', hhp_villager.name, ' NH Villager Icon.png|25px|link=|alt=|', hhp_villager.name, ']] [[', hhp_villager._pageTitle, '|', hhp_villager.name, ']]' )|where=hhp_villager.item1 = "{{#replace:{{{item|{{#replace:{{#titleparts:{{PAGENAME}}||-1}}|<nowiki/> <nowiki/>(New Horizons)|}}}}}|'|\'}}" OR hhp_villager.item2 = "{{#replace:{{{item|{{#replace:{{#titleparts:{{PAGENAME}}||-1}}|<nowiki/> <nowiki/>(New Horizons)|}}}}}|'|\'}}" OR hhp_villager.item3 = "{{#replace:{{{item|{{#replace:{{#titleparts:{{PAGENAME}}||-1}}|<nowiki/> <nowiki/>(New Horizons)|}}}}}|'|\'}}"|limit=300|order by=hhp_villager.name_sort|default=}}}}{{#vardefine:wardell|{{#cargo_query: table=nh_furniture|fields=nh_furniture.buy2_price|where=nh_furniture.en_name = "{{#replace:{{{item|{{#replace:{{#titleparts:{{PAGENAME}}||-1}}|<nowiki/> <nowiki/>(New Horizons)|}}}}}|'|\'}}"|limit=2000|default=|no html}}}}{{#vardefine:paradise|{{#cargo_query: table=nh_furniture|fields=nh_furniture.availability2|where=nh_furniture.en_name = "{{#replace:{{{item|{{#replace:{{#titleparts:{{PAGENAME}}||-1}}|<nowiki/> <nowiki/>(New Horizons)|}}}}}|'|\'}}"|limit=2000|default=|no html}}}}{{#if: {{#var: result-nh}}|This item appears in the homes of the following villagers: {{#var: result-nh}}.|No villagers have this item in their home.}}{{#if: {{{prune-hhp|}}}||&#32;{{#if: {{#var: result-hhp}}|In {{HHP|short}}, this item is unlocked for usage in house designing when doing a vacation home request for the following villagers: {{#var: result-hhp}}.{{#if: {{#var: required}}|&#32;The item is also required to be used in the vacation homes of the following villagers: {{#var: required}}.}}{{#if: {{#var: wardell}}|&#32;After unlocking this item, the item can be purchased from [[Wardell]]'s catalog{{#switch:{{#var:paradise}}|Paradise Planning office|Café=|#default=&#32;for {{Currency|Poki|{{#var:wardell}}}}}}.}}|In {{HHP|short}}, no villagers unlock this item for usage in designing a vacation home, and it can only be used once the player's [[catalog]] is unlocked after completing the 25th vacation home.}}}}<noinclude>{{clear}}<br>{{Documentation}}[[Category:Cargo templates]]</noinclude>

Revision as of 22:40, November 26, 2021

No villagers have this item in their home. In Happy Home Paradise, no villagers unlock this item for usage in designing a vacation home, and it can only be used once the player's catalog is unlocked after completing the 25th vacation home.


Template documentation (view)


Lua Logo.svg
This template is using a Lua module
To change certain features of this template, the following modules will need to be edited:
  • Module:NHVillagerItemOutput
  • Note that any changes should first be tested in a sandbox. Please consider discussing planned changes on the talk page or with staff members before implementing them.
    Lua Logo.svg
    This template is using a Lua module
    To change certain features of this template, the following modules will need to be edited:
  • Module:NHVillagerItemOutput
  • Note that any changes should first be tested in a sandbox. Please consider discussing planned changes on the talk page or with staff members before implementing them.
    More Cargo templates

    When placed on a Animal Crossing: New Horizons furniture page, this template will automatically produce a list of villagers whose houses have that furniture by default. If no villagers have the item in their house by default, the template will output "No villagers have this item in their home.".

    The template will also provide a list of villagers that will unlock the furniture item to use for house designing in Animal Crossing: New Horizons – Happy Home Paradise. The list may also specify if it can be ordered from Wardell's catalog at the Poki price specified. If no villagers have the item available to be unlocked, the template will output "In Happy Home Paradise, no villagers or facility unlock this item for designing. It can only be used once the player's catalog is unlocked after completing the 27th vacation home.".

    This template will automatically extract the furniture name from the page title, so there is no need to specify any parameters; if needed, however, the item can be specified via the item parameter.

    This template pulls data from the nh_house, hhp_villager, and nh_furniture Cargo table. If a villager's mention is inaccurate or if the Poki price is inaccurate, it should be fixed in House Info template, Happy Home Paradise villager info template, and New Horizons furniture infobox template respectively that appears on their article. For more information on Cargo, refer to our Cargo documentation.

    Examples

    {{NHFurnitureVillagers|item=Log Bench}}

    This item appears in the homes of the following villagers: Amelia, Beau, Dom, Egbert, Flora, Grizzly, Hans, Jay, Mac, Maddie, Norma, Phoebe, Poppy, Prince, Rex, Ricky, Roald, Scoot, Zucker. In Happy Home Paradise, this item is unlocked for usage in house designing when doing a vacation home request for the following villagers: Alli, Benjamin, Bianca, Broffina, Butch, Cranston, Deirdre, Dora, Drift, Hans, Julia, Leopold, Louie, Maple, O'Hare, Savannah, Tasha.