[tw5] Re: Hide $count if zero

2018-07-29 Thread Diego Mesa
Thank you Eric! Each time you post this I a reminded of all the other times 
you post this! Thank you for being patient and persistent.

Diego

On Saturday, July 28, 2018 at 5:30:43 PM UTC-5, Eric Shulman wrote:
>
> On Saturday, July 28, 2018 at 1:28:39 PM UTC-7, Mark S. wrote:
>>
>> AFAIK state can only take a text reference. The Reveal widget acts the 
>> most like structures in other languages that people are familiar with, so 
>> it would be useful if it could make variable/variable comparisons as well. 
>> On Saturday, July 28, 2018 at 1:00:58 PM UTC-7, Diego Mesa wrote:
>>>
>>> Thanks for this! Just to confirm, state *can't* take a variable 
>>> directly right? Like:
>>> <$reveal state=<> type="nomatch" text="0"
>>> <>
>>> 
>>>
>>
> In the <$reveal> widget, you can use default=... parameter to specify a 
> value from a variable, as documented:
>
> default Default value to use when the state tiddler is missing
>
> Thus, OMIT the state=... param, and use default=... instead:
> <$reveal text=<> type="nomatch" default="0">
>
> enjoy,
> -e
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8d16aa75-336e-42d9-a625-58f4dc51d774%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Hide $count if zero

2018-07-28 Thread TonyM
Just a tip for all.

When you want to put a variable in a widget parameter use the macrocall widget 
instead to invoke the widget then you can pass variables.

Regards
Tony

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/53b7ee09-3434-46eb-bad5-2322722e402b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Hide $count if zero

2018-07-28 Thread Eric Shulman
On Saturday, July 28, 2018 at 1:28:39 PM UTC-7, Mark S. wrote:
>
> AFAIK state can only take a text reference. The Reveal widget acts the 
> most like structures in other languages that people are familiar with, so 
> it would be useful if it could make variable/variable comparisons as well. 
> On Saturday, July 28, 2018 at 1:00:58 PM UTC-7, Diego Mesa wrote:
>>
>> Thanks for this! Just to confirm, state *can't* take a variable directly 
>> right? Like:
>> <$reveal state=<> type="nomatch" text="0"
>> <>
>> 
>>
>
In the <$reveal> widget, you can use default=... parameter to specify a 
value from a variable, as documented:

default Default value to use when the state tiddler is missing

Thus, OMIT the state=... param, and use default=... instead:
<$reveal text=<> type="nomatch" default="0">

enjoy,
-e


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/00532fcf-85fc-4dc9-9033-80b2d184800d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Hide $count if zero

2018-07-28 Thread 'Mark S.' via TiddlyWiki
AFAIK state can only take a text reference. The Reveal widget acts the most 
like structures in other languages that people are familiar with, so it 
would be useful if it could make variable/variable comparisons as well. 

-- Mark

On Saturday, July 28, 2018 at 1:00:58 PM UTC-7, Diego Mesa wrote:
>
> Hey Mark,
>
> Thanks for this! Just to confirm, state *can't* take a variable directly 
> right? Like:
>
> <$reveal state=<> type="nomatch" text="0"
> <>
> 
>
> I tried it but it didnt work for me so Im just making sure Im not doing 
> anything silly.
>
>
> On Saturday, July 28, 2018 at 1:03:02 PM UTC-5, Mark S. wrote:
>>
>> That could work too, though it would involve making an extra tiddler to 
>> put the comparison zero and more widgets:
>>
>> <$list filter="[has[yourfilter]count[]]" variable=result >
>> <$reveal state="zerostate" type="match" text=<>>
>> NOTHING HERE FOLKS!
>> 
>> <$reveal state="zerostate" type="nomatch" text=<>>
>> <>
>> 
>> 
>>
>> (assumes you've made "zerostate" a tiddler populated with a "0".
>>
>> -- Mark
>>
>> On Saturday, July 28, 2018 at 10:48:43 AM UTC-7, Diego Mesa wrote:
>>>
>>> Hey mark,
>>>
>>> Good idea. Why doesnt using a reveal and comparing against "0" work? 
>>>
>>> Diego
>>>
>>> On Saturday, July 28, 2018 at 12:17:18 PM UTC-5, Mark S. wrote:

 A filter ending in count[] will never be empty because zero is a 
 number! But (at least in my test) you can subtract out the 0:

 <$list filter="[tagcount[]] -[[0]]" variable=result 
 emptyMessage="none">

 Then it will return "none" for the zero count.

 -- Mark

 On Saturday, July 28, 2018 at 9:18:29 AM UTC-7, Joe Bush wrote:
>
> When I use
>
> <$list filter="[tagcount[]]" variable=result 
> emptyMessage="none">
> <>
> 
>
> I still get zeroes as the return. I added the empty message and it 
> doesn't show up, returns 0 instead.
>
> On Wednesday, July 25, 2018 at 6:56:31 PM UTC-5, TonyM wrote:
>>
>> Joe,
>>
>> Try using count as a filter operator on a list
>>
>> <$list filter="[yourfilter]count[]" variable=result>
>> <>
>> 
>>
>> In the above case result will display the count, but nothing will 
>> show if nothing or 0 items are in the result.
>>
>> And you could extend this with the emptyMessage (not what you are 
>> asking for)
>>
>> <$list filter="[yourfilter]count[]" variable=result 
>> emptyMessage="none">
>> <>
>> 
>>
>> Regards
>> Tony
>>
>>
>>
>> On Thursday, July 26, 2018 at 8:05:23 AM UTC+10, Joe Bush wrote:
>>>
>>> In part of my $list tree I display a $count of the children of a 
>>> given tiddler. Is there a way to hide or not display the <$count> 
>>> element 
>>> if it returns 0?
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/671b20ad-49ed-4a92-a536-166c859d1fcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Hide $count if zero

2018-07-28 Thread Diego Mesa
Hey Mark,

Thanks for this! Just to confirm, state *can't* take a variable directly 
right? Like:

<$reveal state=<> type="nomatch" text="0"
<>


I tried it but it didnt work for me so Im just making sure Im not doing 
anything silly.


On Saturday, July 28, 2018 at 1:03:02 PM UTC-5, Mark S. wrote:
>
> That could work too, though it would involve making an extra tiddler to 
> put the comparison zero and more widgets:
>
> <$list filter="[has[yourfilter]count[]]" variable=result >
> <$reveal state="zerostate" type="match" text=<>>
> NOTHING HERE FOLKS!
> 
> <$reveal state="zerostate" type="nomatch" text=<>>
> <>
> 
> 
>
> (assumes you've made "zerostate" a tiddler populated with a "0".
>
> -- Mark
>
> On Saturday, July 28, 2018 at 10:48:43 AM UTC-7, Diego Mesa wrote:
>>
>> Hey mark,
>>
>> Good idea. Why doesnt using a reveal and comparing against "0" work? 
>>
>> Diego
>>
>> On Saturday, July 28, 2018 at 12:17:18 PM UTC-5, Mark S. wrote:
>>>
>>> A filter ending in count[] will never be empty because zero is a number! 
>>> But (at least in my test) you can subtract out the 0:
>>>
>>> <$list filter="[tagcount[]] -[[0]]" variable=result 
>>> emptyMessage="none">
>>>
>>> Then it will return "none" for the zero count.
>>>
>>> -- Mark
>>>
>>> On Saturday, July 28, 2018 at 9:18:29 AM UTC-7, Joe Bush wrote:

 When I use

 <$list filter="[tagcount[]]" variable=result 
 emptyMessage="none">
 <>
 

 I still get zeroes as the return. I added the empty message and it 
 doesn't show up, returns 0 instead.

 On Wednesday, July 25, 2018 at 6:56:31 PM UTC-5, TonyM wrote:
>
> Joe,
>
> Try using count as a filter operator on a list
>
> <$list filter="[yourfilter]count[]" variable=result>
> <>
> 
>
> In the above case result will display the count, but nothing will show 
> if nothing or 0 items are in the result.
>
> And you could extend this with the emptyMessage (not what you are 
> asking for)
>
> <$list filter="[yourfilter]count[]" variable=result 
> emptyMessage="none">
> <>
> 
>
> Regards
> Tony
>
>
>
> On Thursday, July 26, 2018 at 8:05:23 AM UTC+10, Joe Bush wrote:
>>
>> In part of my $list tree I display a $count of the children of a 
>> given tiddler. Is there a way to hide or not display the <$count> 
>> element 
>> if it returns 0?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3418d8dc-3463-45ef-8de0-b7d677fd96be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Hide $count if zero

2018-07-28 Thread Joe Bush
Thanks Mark. This worked like a charm:

<$list filter="[tagcount[]] -[[0]]" variable=result>
<>


On Saturday, July 28, 2018 at 12:17:18 PM UTC-5, Mark S. wrote:
>
> A filter ending in count[] will never be empty because zero is a number! 
> But (at least in my test) you can subtract out the 0:
>
> <$list filter="[tagcount[]] -[[0]]" variable=result 
> emptyMessage="none">
>
> Then it will return "none" for the zero count.
>
> -- Mark
>
> On Saturday, July 28, 2018 at 9:18:29 AM UTC-7, Joe Bush wrote:
>>
>> When I use
>>
>> <$list filter="[tagcount[]]" variable=result 
>> emptyMessage="none">
>> <>
>> 
>>
>> I still get zeroes as the return. I added the empty message and it 
>> doesn't show up, returns 0 instead.
>>
>> On Wednesday, July 25, 2018 at 6:56:31 PM UTC-5, TonyM wrote:
>>>
>>> Joe,
>>>
>>> Try using count as a filter operator on a list
>>>
>>> <$list filter="[yourfilter]count[]" variable=result>
>>> <>
>>> 
>>>
>>> In the above case result will display the count, but nothing will show 
>>> if nothing or 0 items are in the result.
>>>
>>> And you could extend this with the emptyMessage (not what you are asking 
>>> for)
>>>
>>> <$list filter="[yourfilter]count[]" variable=result emptyMessage="none">
>>> <>
>>> 
>>>
>>> Regards
>>> Tony
>>>
>>>
>>>
>>> On Thursday, July 26, 2018 at 8:05:23 AM UTC+10, Joe Bush wrote:

 In part of my $list tree I display a $count of the children of a given 
 tiddler. Is there a way to hide or not display the <$count> element if it 
 returns 0?

>>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/436007ed-a419-4818-a5eb-878884bd3446%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Hide $count if zero

2018-07-28 Thread 'Mark S.' via TiddlyWiki
That could work too, though it would involve making an extra tiddler to put 
the comparison zero and more widgets:

<$list filter="[has[yourfilter]count[]]" variable=result >
<$reveal state="zerostate" type="match" text=<>>
NOTHING HERE FOLKS!

<$reveal state="zerostate" type="nomatch" text=<>>
<>



(assumes you've made "zerostate" a tiddler populated with a "0".

-- Mark

On Saturday, July 28, 2018 at 10:48:43 AM UTC-7, Diego Mesa wrote:
>
> Hey mark,
>
> Good idea. Why doesnt using a reveal and comparing against "0" work? 
>
> Diego
>
> On Saturday, July 28, 2018 at 12:17:18 PM UTC-5, Mark S. wrote:
>>
>> A filter ending in count[] will never be empty because zero is a number! 
>> But (at least in my test) you can subtract out the 0:
>>
>> <$list filter="[tagcount[]] -[[0]]" variable=result 
>> emptyMessage="none">
>>
>> Then it will return "none" for the zero count.
>>
>> -- Mark
>>
>> On Saturday, July 28, 2018 at 9:18:29 AM UTC-7, Joe Bush wrote:
>>>
>>> When I use
>>>
>>> <$list filter="[tagcount[]]" variable=result 
>>> emptyMessage="none">
>>> <>
>>> 
>>>
>>> I still get zeroes as the return. I added the empty message and it 
>>> doesn't show up, returns 0 instead.
>>>
>>> On Wednesday, July 25, 2018 at 6:56:31 PM UTC-5, TonyM wrote:

 Joe,

 Try using count as a filter operator on a list

 <$list filter="[yourfilter]count[]" variable=result>
 <>
 

 In the above case result will display the count, but nothing will show 
 if nothing or 0 items are in the result.

 And you could extend this with the emptyMessage (not what you are 
 asking for)

 <$list filter="[yourfilter]count[]" variable=result emptyMessage="none">
 <>
 

 Regards
 Tony



 On Thursday, July 26, 2018 at 8:05:23 AM UTC+10, Joe Bush wrote:
>
> In part of my $list tree I display a $count of the children of a given 
> tiddler. Is there a way to hide or not display the <$count> element if it 
> returns 0?
>


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/01464355-7989-4143-a429-a19a737d999e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Hide $count if zero

2018-07-28 Thread Diego Mesa
Hey mark,

Good idea. Why doesnt using a reveal and comparing against "0" work? 

Diego

On Saturday, July 28, 2018 at 12:17:18 PM UTC-5, Mark S. wrote:
>
> A filter ending in count[] will never be empty because zero is a number! 
> But (at least in my test) you can subtract out the 0:
>
> <$list filter="[tagcount[]] -[[0]]" variable=result 
> emptyMessage="none">
>
> Then it will return "none" for the zero count.
>
> -- Mark
>
> On Saturday, July 28, 2018 at 9:18:29 AM UTC-7, Joe Bush wrote:
>>
>> When I use
>>
>> <$list filter="[tagcount[]]" variable=result 
>> emptyMessage="none">
>> <>
>> 
>>
>> I still get zeroes as the return. I added the empty message and it 
>> doesn't show up, returns 0 instead.
>>
>> On Wednesday, July 25, 2018 at 6:56:31 PM UTC-5, TonyM wrote:
>>>
>>> Joe,
>>>
>>> Try using count as a filter operator on a list
>>>
>>> <$list filter="[yourfilter]count[]" variable=result>
>>> <>
>>> 
>>>
>>> In the above case result will display the count, but nothing will show 
>>> if nothing or 0 items are in the result.
>>>
>>> And you could extend this with the emptyMessage (not what you are asking 
>>> for)
>>>
>>> <$list filter="[yourfilter]count[]" variable=result emptyMessage="none">
>>> <>
>>> 
>>>
>>> Regards
>>> Tony
>>>
>>>
>>>
>>> On Thursday, July 26, 2018 at 8:05:23 AM UTC+10, Joe Bush wrote:

 In part of my $list tree I display a $count of the children of a given 
 tiddler. Is there a way to hide or not display the <$count> element if it 
 returns 0?

>>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/c1f0c4ec-69f4-43bf-a0bf-c04944d8015c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Hide $count if zero

2018-07-28 Thread 'Mark S.' via TiddlyWiki
A filter ending in count[] will never be empty because zero is a number! 
But (at least in my test) you can subtract out the 0:

<$list filter="[tagcount[]] -[[0]]" variable=result 
emptyMessage="none">

Then it will return "none" for the zero count.

-- Mark

On Saturday, July 28, 2018 at 9:18:29 AM UTC-7, Joe Bush wrote:
>
> When I use
>
> <$list filter="[tagcount[]]" variable=result 
> emptyMessage="none">
> <>
> 
>
> I still get zeroes as the return. I added the empty message and it doesn't 
> show up, returns 0 instead.
>
> On Wednesday, July 25, 2018 at 6:56:31 PM UTC-5, TonyM wrote:
>>
>> Joe,
>>
>> Try using count as a filter operator on a list
>>
>> <$list filter="[yourfilter]count[]" variable=result>
>> <>
>> 
>>
>> In the above case result will display the count, but nothing will show if 
>> nothing or 0 items are in the result.
>>
>> And you could extend this with the emptyMessage (not what you are asking 
>> for)
>>
>> <$list filter="[yourfilter]count[]" variable=result emptyMessage="none">
>> <>
>> 
>>
>> Regards
>> Tony
>>
>>
>>
>> On Thursday, July 26, 2018 at 8:05:23 AM UTC+10, Joe Bush wrote:
>>>
>>> In part of my $list tree I display a $count of the children of a given 
>>> tiddler. Is there a way to hide or not display the <$count> element if it 
>>> returns 0?
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/9b309fa0-f6b3-4329-bca1-3ffea0f3006c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Hide $count if zero

2018-07-28 Thread Joe Bush
When I use

<$list filter="[tagcount[]]" variable=result 
emptyMessage="none">
<>


I still get zeroes as the return. I added the empty message and it doesn't 
show up, returns 0 instead.

On Wednesday, July 25, 2018 at 6:56:31 PM UTC-5, TonyM wrote:
>
> Joe,
>
> Try using count as a filter operator on a list
>
> <$list filter="[yourfilter]count[]" variable=result>
> <>
> 
>
> In the above case result will display the count, but nothing will show if 
> nothing or 0 items are in the result.
>
> And you could extend this with the emptyMessage (not what you are asking 
> for)
>
> <$list filter="[yourfilter]count[]" variable=result emptyMessage="none">
> <>
> 
>
> Regards
> Tony
>
>
>
> On Thursday, July 26, 2018 at 8:05:23 AM UTC+10, Joe Bush wrote:
>>
>> In part of my $list tree I display a $count of the children of a given 
>> tiddler. Is there a way to hide or not display the <$count> element if it 
>> returns 0?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ae9cd488-63ca-408f-b59a-81957fc625c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Hide $count if zero

2018-07-25 Thread TonyM
Joe,

Try using count as a filter operator on a list

<$list filter="[yourfilter]count[]" variable=result>
<>


In the above case result will display the count, but nothing will show if 
nothing or 0 items are in the result.

And you could extend this with the emptyMessage (not what you are asking 
for)

<$list filter="[yourfilter]count[]" variable=result emptyMessage="none">
<>


Regards
Tony



On Thursday, July 26, 2018 at 8:05:23 AM UTC+10, Joe Bush wrote:
>
> In part of my $list tree I display a $count of the children of a given 
> tiddler. Is there a way to hide or not display the <$count> element if it 
> returns 0?
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/47fe70e4-74d0-4af1-81de-78c6dccaf473%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.