Design Pattern "Display semantic title inline only when transcluding a page"

From SMW CindyKate by dataspects
Component 531439
Jump to navigation Jump to search
[edit]
Keywords/Contexts

Regex · Ifeq parser function · Transclusion · Semantic titles

Annotations
{{#compound_query:Component 531439Property "-Has subobject" has a restricted application area and cannot be used as annotation property by a user.UseCaseMotivation;?HasDirection;?IsMotivating;?IsMotivatedBy;?HasReasoning
Property "-Has subobject" has a restricted application area and cannot be used as annotation property by a user.Design Pattern "Display semantic title inline only when transcluding a page";?HasDirection;?IsMotivating;?IsMotivatedBy;?HasReasoning Property "-Has subobject" has a restricted application area and cannot be used as annotation property by a user.Design Pattern "Display semantic title inline only when transcluding a page";?HasDirection;?IsMotivating;?IsMotivatedBy;?HasReasoning
name=MotivationsDeclaredOnThisPageResultItem|link=none}}
Motivations
Lua error in Module:Motivations at line 23: attempt to concatenate field 'hasReasoning' (a nil value).
[edit]

Content

Note: This design pattern requires https://www.mediawiki.org/wiki/Extension:Regex_Fun.

A page Clarification 352638 can be transcluded by {{:Clarification 352638}}. The transclusion will then display the {{{Semantic Display Title}}} according to the format specified below while its Has semantic display title declaration will be skipped in order not to interfere with the transcluding page's own Has semantic display title declaration.

{{#ifeq:{{#regex:{{PAGENAME}}|%^(.*) ([0-9]*)$%|$1}}|Clarification|{{#set:Has semantic display title=Clarification "{{{Semantic Display Title}}}"}}<includeonly>[[Category:Clarification]]</includeonly>|'''{{{Semantic Display Title}}}''' <sup>T</sup>}}