| Line 40: |
Line 40: |
| | ===Issues/Clashes=== | | ===Issues/Clashes=== |
| | * Use of {{Q|1048}} qualifier | | * Use of {{Q|1048}} qualifier |
| − | ** Currently the Le Temps GDPR generator ([[MediaWiki:Access.js]]) uses the {{Q|1048}} qualifier when attached to a {{P|10}} snak and prints that text in brackets after each data point in the generated GDPR letter. Originally Alex Bowyer's GDPR Generator ([[User:Alexbfree/Code:GDPRMailAccess.js]]) used {{Q|1048}} qualifier to contain a policy excerpt but these are being migrated to {{P|287}} as we do not want these printed in the letter (also many of them are too long and break the generator. Alex's generator has switched to never print the {{Q|1048}} and he would recommend Le Temps do the same. {{Q|1048}} should be free for use by wiki users to add detail about a snak. For example see the {{P10}} list usage in {{Q|281}}. | + | ** Currently the Le Temps GDPR generator ([[MediaWiki:Access.js]]) uses the {{Q|1048}} qualifier when attached to a {{P|10}} snak and prints that text in brackets after each data point in the generated GDPR letter. Originally Alex Bowyer's GDPR Generator ([[User:Alexbfree/Code:GDPRMailAccess.js]]) used {{Q|1048}} qualifier to contain a policy excerpt but these are being migrated to {{P|287}} as we do not want these printed in the letter (also many of them are too long and break the generator. Alex's generator has switched to never print the {{Q|1048}} and he would recommend Le Temps do the same. {{Q|1048}} should be free for use by wiki users to add detail about a snak. For example see the {{P|10}} list usage in {{Q|281}}. |
| − | * Figuring out how to display a {{P|10}} item's {{P|27}} string if it has one, or its main {{P|10}} item text otherwise. @podehaye has provided an idea for this, detailed here. This is a future To Do for @alexbfree or anyone else who wants to have a go. | + | * Figuring out how to display a {{P|10}} item's {{P|27}} string if it has one, or its main {{P|10}} item text otherwise. |
| − | ```
| + | ** This is a future To Do for @alexbfree or anyone else who wants to have a go. @podehaye has provided an idea for this, detailed here: |
| − | * https://wiki.personaldata.io/wiki/Template:For is a template that essentially applies one template in succession to a bunch of parameters, with a separator (ignore the named variables)
| + | {| class="wikitable" style="margin-left: 50px;|- |
| − | * this is based on the module For https://wiki.personaldata.io/w/index.php?title=Module:For
| + | | [[https://wiki.personaldata.io/wiki/Template:For Template:For]] is a template that essentially applies one template in succession to a bunch of parameters, with a separator (ignore the named variables) |
| − | * do you understand why the template is limited to five named parameters while Module:For does not explicitly implement such limitation?
| + | |- |
| − | * in any case what you want to solve your problem is a module TwoVariableFor, which takes a bunch of parameters and feeds them two at a time into a rendering function that takes a pair of arguments, the second one being possibly empty
| + | | this is based on the module [[https://wiki.personaldata.io/w/index.php?title=Module:For Module:For]] |
| − | * then you want to have something like {{#invoke:TwoVariableFor|call=MyRenderingTemplateInPairs|firstitem|firstqualifier|seconditem||thirditem|thirdqualifier}} (if for instance the second qualifier was missing)
| + | |- |
| − | * now the question is how you generate the list of parameters, but you can use an invoke:Wd for this
| + | | do you understand why the template is limited to five named parameters while Module:For does not explicitly implement such limitation? |
| − | * so: {{#invoke:TwoVariableFor|call=MyRenderingTemplateInPairs|{{#invoke:wd|...what you already know how to do...}}}}
| + | |- |
| − | * it would be awesome if you managed to duplicate and modify Module:For into Module:TwoVariableFor
| + | | in any case what you want to solve your problem is a module TwoVariableFor, which takes a bunch of parameters and feeds them two at a time into a rendering function that takes a pair of arguments, the second one being possibly empty |
| − | ```
| + | |- |
| | + | | then you want to have something like <nowiki>{{#invoke:TwoVariableFor|call=MyRenderingTemplateInPairs|firstitem|firstqualifier|seconditem||thirditem|thirdqualifier}}</nowiki> (( for instance the second qualifier was missing) |
| | + | |- |
| | + | | now the question is how you generate the list of parameters, but you can use an invoke:Wd for this |
| | + | |- |
| | + | | so: <nowiki>{{#invoke:TwoVariableFor|call=MyRenderingTemplateInPairs|{{#invoke:wd|...what you already know how to do...}}}}</nowiki> |
| | + | |- |
| | + | | it would be awesome if you managed to duplicate and modify <nowiki>Module:For</nowiki> into <nowiki>Module:TwoVariableFor</nowiki> |
| | + | |} |
| | + | |
| | + | * Until this is done, the current workaround in Alex Bowyer's GDPR Generator ([[User:Alexbfree/Code:GDPRMailAccess.js]]) is to show <pre><named as> / <collects-text></pre> if there is a {{P|27}}, or <pre><collects-text></pre> otherwise. The latter part can be manually deleted from the generated letter on {{P|27}} items. |
| | | | |
| | ===FAQ=== | | ===FAQ=== |