« Test Subobject 0001 » : différence entre les versions

De Semantic MediaWiki - Sandbox

Aucun résumé des modifications
Balise : Éditeur de wikicode 2017
Aucun résumé des modifications
Balise : Éditeur de wikicode 2017
 
(7 versions intermédiaires par 2 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
'''This page contains to subobjects as defined by the template [[Modèle:Test_Subobject_0001]].'''
{{Test Subobject 0001
{{Test Subobject 0001
|SO-ID=1
|SO-ID=1
Ligne 11 : Ligne 13 :
}}
}}


{{FULLPAGE}}
'''Then there is an inline query with '''
<syntaxhighlight>[[Has subobject::{{{FULLPAGENAME}}}]]</syntaxhighlight>
 
{{#ask: [[Has subobject::{{{FULLPAGENAME}}}]]
      |?Has number = SO-ID
      |?Has name  = SO-Name
      |?Has Status = SO-Status
      |default    = No Subobject found
}}
 
'''Followed by an inline query with '''
<syntaxhighlight>[[Has subobject::+]] [[Has name::+]]  [[Has Status::+]]</syntaxhighlight>


{{#ask: [[Has subobject::{{{FULLPAGE}}}]]
{{#ask: [[Has subobject::+]] [[Has name::+]] [[Has Status::+]]
       |?Has number = SO-ID
       |?Has number = SO-ID
       |?Has name  = SO-Name
       |?Has name  = SO-Name
Ligne 19 : Ligne 32 :
       |default    = No Subobject found
       |default    = No Subobject found
}}
}}
== Notes ==
There are several issues in how you use/apply subobjects (and the #ask) query.
First of all, the template [[Modèle:Test_Subobject_0001]] uses `::` as notation which is not supported, please see the documentation (e.g. Has number=...).
<pre><nowiki>
{{#subobject:Test Subobject 0001 with {{{SO-ID|}}}
            |Has number::{{{SO-ID|}}}
            |Has name::{{{SO-Name|}}}
            |Has status::{{{SO-Status|}}}
}}
</nowiki></pre>
Secondly, <nowiki>{{#ask: [[Has subobject::{{{FULLPAGENAME}}}]] </nowiki> is not going to work because the subobject is not identified as `Test_Subobject_0001`. If you insist on using  <nowiki>{{{FULLPAGENAME}}}</nowiki> you have to use the inverted form as in <nowiki>[[-Has subobject::{{{FULLPAGENAME}}}]]</nowiki>.
== Thanks for the advice ==
Your are right and I wonder why I did not see this when comparing my working definition and query with the not working ones. I belive that one gets sometimes somehow blind for the code one has written.

Dernière version du 12 juillet 2018 à 14:18

This page contains to subobjects as defined by the template Modèle:Test_Subobject_0001.

Then there is an inline query with

[[Has subobject::{{{FULLPAGENAME}}}]]

No Subobject found

Followed by an inline query with

[[Has subobject::+]] [[Has name::+]]  [[Has Status::+]]

No Subobject found

Notes

There are several issues in how you use/apply subobjects (and the #ask) query.

First of all, the template Modèle:Test_Subobject_0001 uses `::` as notation which is not supported, please see the documentation (e.g. Has number=...).

{{#subobject:Test Subobject 0001 with {{{SO-ID|}}}
            |Has number::{{{SO-ID|}}}
            |Has name::{{{SO-Name|}}}
            |Has status::{{{SO-Status|}}}
}}

Secondly, {{#ask: [[Has subobject::{{{FULLPAGENAME}}}]] is not going to work because the subobject is not identified as `Test_Subobject_0001`. If you insist on using {{{FULLPAGENAME}}} you have to use the inverted form as in [[-Has subobject::{{{FULLPAGENAME}}}]].

Thanks for the advice

Your are right and I wonder why I did not see this when comparing my working definition and query with the not working ones. I belive that one gets sometimes somehow blind for the code one has written.

Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.