Template:Orchard Infobox: Difference between revisions
From Heritage Apple Corps
Make tree count and species breakdown automatic using SMW queries |
Fix species breakdown - remove Variables extension dependency |
||
| Line 8: | Line 8: | ||
| '''Tree Count''' || {{#ask: [[Has orchard::{{{name}}}]] |format=count}} | | '''Tree Count''' || {{#ask: [[Has orchard::{{{name}}}]] |format=count}} | ||
|- | |- | ||
| '''Species''' || {{# | | '''Species''' || {{#ifexpr: {{#ask: [[Has orchard::{{{name}}}]] [[Has species::Apple]] |format=count}} > 0 | {{#ask: [[Has orchard::{{{name}}}]] [[Has species::Apple]] |format=count}} apple|}}<nowiki/>{{#ifexpr: {{#ask: [[Has orchard::{{{name}}}]] [[Has species::Pear]] |format=count}} > 0 | {{#ifexpr: {{#ask: [[Has orchard::{{{name}}}]] [[Has species::Apple]] |format=count}} > 0 |, |}}{{#ask: [[Has orchard::{{{name}}}]] [[Has species::Pear]] |format=count}} pear|}}<nowiki/>{{#ifexpr: {{#ask: [[Has orchard::{{{name}}}]] [[Has species::Plum]] |format=count}} > 0 | {{#ifexpr: ({{#ask: [[Has orchard::{{{name}}}]] [[Has species::Apple]] |format=count}} + {{#ask: [[Has orchard::{{{name}}}]] [[Has species::Pear]] |format=count}}) > 0 |, |}}{{#ask: [[Has orchard::{{{name}}}]] [[Has species::Plum]] |format=count}} plum|}}<nowiki/>{{#ifexpr: {{#ask: [[Has orchard::{{{name}}}]] [[Has species::Apricot]] |format=count}} > 0 | {{#ifexpr: ({{#ask: [[Has orchard::{{{name}}}]] [[Has species::Apple]] |format=count}} + {{#ask: [[Has orchard::{{{name}}}]] [[Has species::Pear]] |format=count}} + {{#ask: [[Has orchard::{{{name}}}]] [[Has species::Plum]] |format=count}}) > 0 |, |}}{{#ask: [[Has orchard::{{{name}}}]] [[Has species::Apricot]] |format=count}} apricot|}} | ||
|- | |- | ||
{{#if:{{{variety_count}}}| | {{#if:{{{variety_count}}}| | ||
| Line 39: | Line 39: | ||
</pre> | </pre> | ||
'''Note:''' Tree counts and species breakdown are now calculated automatically using Semantic MediaWiki queries. You no longer need to provide tree_count or species_breakdown parameters - they will be computed from the trees that have [[Has orchard::OrchardName]] set. | '''Note:''' Tree counts and species breakdown are now calculated automatically using Semantic MediaWiki queries. You no longer need to provide tree_count or species_breakdown parameters - they will be computed from the trees that have <nowiki>[[Has orchard::OrchardName]]</nowiki> set. | ||
[[Category:Infobox templates]] | [[Category:Infobox templates]] | ||
</noinclude> | </noinclude> | ||
Revision as of 12:05, 5 February 2026
| Example Orchard | |
|---|---|
| Location | Crooked River National Grassland |
| Tree Count | 0 |
| Species | |
| Varieties | 12 identified |
| NRHP | Listed2015-05-26 |
Usage
{{Orchard Infobox
|name=
|location=
|variety_count=
|national_register=
|nrhp_date=
}}
Note: Tree counts and species breakdown are now calculated automatically using Semantic MediaWiki queries. You no longer need to provide tree_count or species_breakdown parameters - they will be computed from the trees that have [[Has orchard::OrchardName]] set.

