Template:Template sandbox: Difference between revisions
(RequiredBy2 clone (test setup).) Tag: Reverted |
(Apply RequiredBy2/output calls.) Tag: Reverted |
||
Line 18: | Line 18: | ||
| {{#switch: {{{1}}} | | {{#switch: {{{1}}} | ||
| specifics = <!-- | | specifics = <!-- "specifics" mode -- Return specific-names list for target item. | ||
-->{{#if: {{{2|}}} | -->{{#if: {{{2|}}} | ||
| {{#ifeq:{{NAMESPACE}}|{{ns:legacy}} | | {{#ifeq:{{NAMESPACE}}|{{ns:legacy}} | ||
| | | {{#show: {{{2}}} | ?legacy-specific | format=plainlist | link = none }} | ||
| {{List_normalize|{{#replace: {{#replace: {{#show: {{{2}}} | ?specific | | {{List_normalize|{{#replace: {{#replace: {{#show: {{{2}}} | ?specific | format=plainlist | link = none }} | Generics }} | {{{2|}}} }} }} | ||
}}<!-- if:ns:close | }}<!-- if:ns:close | ||
-->{{#if: {{#pos:{{#show:{{{2}}}|?specific|format=plainlist|link=none}}|{{{2}}}}} | {{#set:Test_Text={{{2}}};{{#show:{{{2}}}|?specific|format=plainlist|link=none}}|+sep=*}} }}<!-- additional debug-data dumping. | -->{{#if: {{#pos:{{#show:{{{2}}}|?specific|format=plainlist|link=none}}|{{{2}}}}} | {{#set:Test_Text={{{2}}};{{#show:{{{2}}}|?specific|format=plainlist|link=none}}|+sep=*}} }}<!-- additional debug-data dumping. | ||
-->}}<!-- if:2:close | -->}}<!-- if:2:close (NOP if P2 is not given) | ||
-->| #default = <!-- | -->| #default = <!-- General mode -- | ||
-->{{#ifeq:{{NAMESPACE}}|{{ns:legacy}} | -->{{#ifeq:{{NAMESPACE}}|{{ns:legacy}} | ||
| {{#if: {{{2|}}}<!-- | | {{#if: {{{2|}}}<!-- legacy -- | ||
-->| {{#if: {{#ask: [[legacy-requires::{{{1}}}]]}} | {{#ask: [[legacy-requires::{{{1}}}]]}}, }}{{ | -->| {{#if: {{#ask: [[legacy-requires::{{{1}}}]]}} | {{#ask: [[legacy-requires::{{{1}}}]]}}, }}{{ | ||
#if: {{#explode:{{{2}}}|,|0}} | <b>(</b><i>{{#explode:{{{2}}}|,|0}}</i><b>:</b> {{#ask: [[legacy-requires::{{#explode:{{{2}}}|,|0}}]]}}<b>)</b>}}{{ | #if: {{#explode:{{{2}}}|,|0}} | <b>(</b><i>{{#explode:{{{2}}}|,|0}}</i><b>:</b> {{#ask: [[legacy-requires::{{#explode:{{{2}}}|,|0}}]]}}<b>)</b>}}{{ | ||
Line 42: | Line 42: | ||
}}<!-- if:2:close --> | }}<!-- if:2:close --> | ||
| {{#if: {{{2|}}}<!-- | | {{#if: {{{2|}}}<!-- main/hafen -- | ||
-->| {{#if: {{#ask: [[requires::{{{1}}}]]}} | {{ | -->| {{#if: {{#ask: [[requires::{{{1}}}]]}} | {{RequiredBy2/output|main|{{{1}}}}}{{RequiredBy2/output|dlm}}}}{{<!-- ask item-specific RB's -- next do same for specific-names --> | ||
#if: {{#explode:{{{2}}}|,|0}} | | #if: {{#explode:{{{2}}}|,|0}} | {{RequiredBy2/output|type|{{#explode:{{{2}}}|,|0}}}}}}{{ | ||
#if: {{#explode:{{{2}}}|,|1}} | | #if: {{#explode:{{{2}}}|,|1}} |{{RequiredBy2/output|dlm}} {{RequiredBy2/output|type|{{#explode:{{{2}}}|,|1}}}}}}{{ | ||
#if: {{#explode:{{{2}}}|,|2}} | | #if: {{#explode:{{{2}}}|,|2}} |{{RequiredBy2/output|dlm}} {{RequiredBy2/output|type|{{#explode:{{{2}}}|,|2}}}}}}{{ | ||
#if: {{#explode:{{{2}}}|,|3}} | | #if: {{#explode:{{{2}}}|,|3}} |{{RequiredBy2/output|dlm}} {{RequiredBy2/output|type|{{#explode:{{{2}}}|,|3}}}}}}{{ | ||
#if: {{#explode:{{{2}}}|,|4}} | | #if: {{#explode:{{{2}}}|,|4}} |{{RequiredBy2/output|dlm}} {{RequiredBy2/output|type|{{#explode:{{{2}}}|,|4}}}}}} | ||
| {{#if: {{#ask: [[requires::{{{1}}}]]}} | {{ | | {{#if: {{#ask: [[requires::{{{1}}}]]}} | {{RequiredBy2/output|main|{{{1}}}}} | {{RequiredBy2/output|none}} }}<!-- item-specific only case, no specific-names given --> | ||
}}<!-- if:2:close --> | }}<!-- if:2:close --> | ||
Line 67: | Line 67: | ||
--><! -- Preview/Debug. -- | --><! -- Preview/Debug. -- | ||
---- | x1) {{RequiredBy2 | specifics | Stinging_Nettle }} <!-- specific-names list. --> | ||
:Stinging_Nettle | |||
x2) {{RequiredBy2 | Stinging_Nettle }} <!-- page/item specific usages only. --> | |||
.... ... ... | |||
:Stinging_Nettle full output: | |||
"{{{{PAGENAME}} | Stinging_Nettle | {{{{PAGENAME}} | specifics | Stinging_Nettle}}}}" | |||
.... ... ... | |||
:-0) <i>(no input)</i> {{{{PAGENAME}}}} | :-0) <i>(no input)</i> {{{{PAGENAME}}}} | ||
:-1) <i>(...)</i> {{{{PAGENAME}} | foobar }} | :-1) <i>(...)</i> {{{{PAGENAME}} | foobar }} |
Revision as of 10:14, 4 July 2022
Template sandbox page.
- This is the RoB-template-sandbox where you can play and try out template debugging safely.
- Can be used together with the general sandbox page.
- Note: No semantic in-text annotations when used as stand-alone self-calling template.
<! -- Preview/Debug. --
x1) String,Salad Greens,Flower
x2) (7) Ant Paste, Cucumber Salsa, Horrible Knot, Nettle Pants, Nettle Shirt, Stinging Poultice, Stinging Salad
.... ... ...
- Stinging_Nettle full output:
"(7) Ant Paste, Cucumber Salsa, Horrible Knot, Nettle Pants, Nettle Shirt, Stinging Poultice, Stinging Salad, (String (145): Archery Target, Badger Hide Vest, Badger's Pouch, Bark Reinforcement, Barkboat, Bat Wing, Battle Standard, Batwing Necklace, Bear Cape, Bear Coat, Bear Tooth Talisman, Beast Ring, Beaver Cap, Beaver Wrist Guards, Birchbark Backpack, Boar Tusk Helmet, Bone Arrow, Boreworm Mask, Bouquet of Flowers, Bunny Slippers, Bushcraft Fishingpole, Bushcraft Fishline, Cachalot Charm, Cave Angler Cape, Chef's Hat, Chitin Helmet, Chitin Sequins, Cigar, Cloth Pocket, Cold Compress, Copper Comet, Crabshell Sunfeather, Creel, Cutthroat Cuirass, Cylinder Hat, Demijohn, Dream Catcher, Drying Frame, Ermine Trimming, Feather Band, Feather Duster, Feather Stuffing, Feather Sunfeather, Feather Trinket, Felt Hat, Fiddle & Bow, Flint Knife, Folded Roasting Spit, Fox Hat, Fur Boots... further results), (Salad Greens (16): Autumn Steak, Broiled Burbot, Bush Rolls, Chicken Salad, Crab Cakes, Escargots d'Amour, Molehill, Pan-Seared Fish, Rabbit Food, Red-Shred Salad, Roeboat, Seal Burger, Spicy Salad, Swan Neck, Unbaked Greenleaf Pie, Vegetable Stuffing), (Flower (1): Bouquet of Flowers)"
.... ... ...
- -0) (no input) {{{{PAGENAME}}}}
- -1) (...) (none)
- -2) (...) (foobar2 (0): )