Using format=count together with intro/outro


Just picked up the example from bugzilla using the intro and outro parameter.

{{#ask: [[Property::Value]] 
|format = count
|intro  = Found:   
|outro  =  results:
  is used as space character

null parameter[edit]

What do you think about adding some kind of null parameter to count? The ide is that if nothing is found (count=0) the text in the null parameter will be used. It can be helpful in the following scenarios: 1. We want to make count pretty and add some special text in case nothing is found.

|null= No one

In fact in those cases several parameter would be useful: for 0 and 1 counts.


2. We want to use count in {{#if function}}: in that case it will be null=

Yury Kaktov (talk) 04:03, 5 August 2012 (CEST)

18:47, 4 December 2018

Just in case ...

Available work-around(s):

  {{#ask: [[Property::Value]] | format = count }} | 0 
  | case: Is Zero (just add Zero case pretty print here) 
  | case: Is Not Zero (enclose same #ask-count-code together with additional pretty print)

Or alternatively:

  {{#ask: [[Property::Value]] }}
  | case: Data found == none zero-count (enclose #ask-count-code together with additional pretty print)
  | case: No data found == zero-count (just add Zero case pretty print here) 

_#switch also comes to mind ... but did not checked/tested that one.

If needed one could create a template to take care of the default stuff. So one could use something like this.

| <#ask-count-call> ... or perhaps just the property input data (speculative/untested).
| <zero pretty print text>
| <None-zero leading pretty print text>
| <None-zero trailing pretty print text>
16:06, 11 January 2019