« Utilisateur:Carlo666/Test/Test5 » : différence entre les versions
< Utilisateur:Carlo666 | Test
Aucun résumé des modifications Balise : Éditeur de wikicode 2017 |
mAucun résumé des modifications Balise : Éditeur de wikicode 2017 |
||
Ligne 83 : | Ligne 83 : | ||
}} | }} | ||
Escaping '#' | Escaping '#': | ||
<pre>{{#ask: | <pre>{{#ask: | ||
[[~{{FULLPAGENAME}}/*]] | [[~{{FULLPAGENAME}}/*]] |
Dernière version du 25 septembre 2019 à 15:04
Problem
This query return subpages of current page but also subobjects contained therein:
{{#ask: [[~{{FULLPAGENAME}}/*]] |format=ul }}
Filtering pages by '#' character in the page name
Trying to exclude pages with page name containing '#' produces no results:
{{#ask: [[~{{FULLPAGENAME}}/*]] [[!~*#*]] |format=ul }}
If we escape '#' nothing is filtered:
{{#ask: [[~{{FULLPAGENAME}}/*]] [[!~*\#*]] |format=ul }}
Filtering by a substring of the subobject id works fine:
{{#ask: [[~{{FULLPAGENAME}}/*]] [[!~*sub*]] |format=ul }}
Adding '#' (escaped or not) to the "not like" conditions replicates the above results:
{{#ask: [[~{{FULLPAGENAME}}/*]] [[!~*#sub*]] |format=ul }}
{{#ask: [[~{{FULLPAGENAME}}/*]] [[!~*\#sub*]] |format=ul }}
Now we try to return only pages with page name containing '#', unsuccessfully:
{{#ask: [[~{{FULLPAGENAME}}/*]] [[~*#*]] |format=ul }}
Escaping '#':
{{#ask: [[~{{FULLPAGENAME}}/*]] [[~*\#*]] |format=ul }}
Filtering subobjects by text properties
A text property whose value is equal to the page name as returned above is defined in subpages and subobject.
Excluding pages with property containing '#' does not filter anything:
{{#ask: [[~{{FULLPAGENAME}}/*]] [[SomeTestProperty::!~*#*]] |?SomeTestProperty }}
Same results when '#' is escaped:
{{#ask: [[~{{FULLPAGENAME}}/*]] [[SomeTestProperty::!~*\#*]] |?SomeTestProperty }}
Selecting only pages with property containing '#' produces the expected result:
{{#ask: [[~{{FULLPAGENAME}}/*]] [[SomeTestProperty::~*#*]] |?SomeTestProperty }}
SomeTestProperty | |
---|---|
Carlo666/Test/Test5/Page2 | Carlo666/Test/Test5/Page2#sub1 |
When '#' is escaped no result is returned:
{{#ask: [[~{{FULLPAGENAME}}/*]] [[SomeTestProperty::~*\#*]] |?SomeTestProperty }}