(Created page with "<noinclude> This is the '''QandA sidebar''' template. It should be called in the following format: <pre> {{QandA sidebar}} </pre> </noinclude><includeonly><!-- -->{{#varde...")
 
No edit summary
Line 22: Line 22:
|Value={{#caprint:$base[Base properties][Title]}}
|Value={{#caprint:$base[Base properties][Title]}}
}}{{Sidebar item
}}{{Sidebar item
|Label=Tags
|Label=Tag
|Value={{#caprint:$class[QandA properties][Tags]}}
|Value={{#caprint:$class[QandA properties][Tag]}}
}}
}}
</div><!-- end of .card-body -->
</div><!-- end of .card-body -->
Line 37: Line 37:
// use casize to check if the slot already exists. Then wsedit, else wscreate.
// use casize to check if the slot already exists. Then wsedit, else wscreate.
-->{{#if:{{#casize:$class}}
-->{{#if:{{#casize:$class}}
|{{#tag:wsedit ||target={{PAGEID}} |template=QandA properties |formfield=Tags |mwslot=ws-class-props}}
|{{#tag:wsedit ||target={{PAGEID}} |template=QandA properties |formfield=Tag |mwslot=ws-class-props}}
|<wscreate mwwrite="{{FULLPAGENAME}}" mwtemplate="QandA properties" mwslot="ws-class-props" mwfields="Tags" />
|<wscreate mwwrite="{{FULLPAGENAME}}" mwtemplate="QandA properties" mwslot="ws-class-props" mwfields="Tag" />
}}<!-- end of #if  -->
}}<!-- end of #if  -->


Line 51: Line 51:
}}
}}
{{Sidebar item
{{Sidebar item
|Label=Tags
|Label=Tag
|Value={{#cadefine:$value settings | }}
|Value={{#cadefine:$value settings | }}
{{#cadefine:$values selected |{{#caprint:$class[QandA properties][Tags]}} }}
{{#cadefine:$values selected |{{#caprint:$class[QandA properties][Tag]}} }}
{{#camerge:$value options |$value settings |$values selected }}
{{#camerge:$value options |$value settings |$values selected }}
{{#caunique:$value options}}
{{#caunique:$value options}}
Line 59: Line 59:
   |{{#tag:wsfield|(none)|type=option|value=}}
   |{{#tag:wsfield|(none)|type=option|value=}}
{{#camap:$value options |__Value__|{{#tag:wsfield|__Value__|type=option|value=__Value__|selected={{#if:{{#casearch:$values selected|__Value__}}|selected}} }} |}}
{{#camap:$value options |__Value__|{{#tag:wsfield|__Value__|type=option|value=__Value__|selected={{#if:{{#casearch:$values selected|__Value__}}|selected}} }} |}}
   |name=Tags[]  
   |name=Tag[]  
   |class=form-control  
   |class=form-control  
   |id=tags-field  
   |id=tag-field  
   |multiple=multiple
   |multiple=multiple
}}
}}

Revision as of 17:10, 9 August 2022


This is the QandA sidebar template. It should be called in the following format:

{{QandA sidebar}}