[tw5] Re: Tiddlername as tag

2020-11-26 Thread Gerald Weis
Hello 

What i wanna do is 
1. Macro see what the user is called in the tiddler title. 
2. Search which devices of the device class e.g. Screen the user has. 
3. Show the devices in the user's tiddler.


soren.b...@gmail.com schrieb am Donnerstag, 26. November 2020 um 15:39:22 
UTC+1:

> My bad, that was a typo caused by my text editor’s bracket autocomplete. 
> It 
> does work with the typo fixed, which is strange because I swear this has 
> not 
> worked for me before. Maybe at the time I didn’t know anything about 
> TiddlyWiki and I was doing something else wrong. Learned something new, 
> thanks! 
>
> Tones, I would think the benefit is that the <__parameter__> syntax can’t 
> get 
> messed up by quoting, no matter what is in the parameter (same reason you 
> might want to use it outside a filter). In your version, if there was a 
> double-quote in the name of the tag, the filter would break. You could use 
> triple quotes around the filter, but then triple quotes would mess it up, 
> and 
> so on.
>
>
> On Wednesday, November 25, 2020 at 6:19:55 PM UTC-6 Mark S. wrote:
>
>> The angle braces REPLACE the square brackets in filter expressions. So 
>> your code should look like:
>>
>> \define testme(parameter)
>>   <$list filter="[tag<__parameter__>]">
>>   <$link to=<>/>
>>   
>> \end
>>
>>
>>
>> On Wednesday, November 25, 2020 at 11:48:56 AM UTC-8 soren.b...@gmail.com 
>> wrote:
>>
>>> On Wednesday, November 25, 2020 at 1:09:22 PM UTC-6 Mark S. wrote:
>>>
 Inside a filter, a variable could be referenced as tag[$art$] or as 
 tag<__art__> .

>>>
>>> Really? Did that work for you? I thought parameters-as-variables only 
>>> work in a strict transclusion context with double angle brackets. In a 
>>> simple test it yields a syntax error:
>>>
>>> \define testme(parameter)
>>>   <$list filter="[tag<__parameter__>]]">
>>>   <$link to=<>/>
>>>   
>>> \end
>>>
>>> <>
>>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/f25a1dc2-d00a-474c-98aa-6dc3b53451e5n%40googlegroups.com.


[tw5] Re: Tiddlername as tag

2020-11-26 Thread soren.b...@gmail.com
My bad, that was a typo caused by my text editor’s bracket autocomplete. It 
does work with the typo fixed, which is strange because I swear this has 
not 
worked for me before. Maybe at the time I didn’t know anything about 
TiddlyWiki and I was doing something else wrong. Learned something new, 
thanks! 

Tones, I would think the benefit is that the <__parameter__> syntax can’t 
get 
messed up by quoting, no matter what is in the parameter (same reason you 
might want to use it outside a filter). In your version, if there was a 
double-quote in the name of the tag, the filter would break. You could use 
triple quotes around the filter, but then triple quotes would mess it up, 
and 
so on.


On Wednesday, November 25, 2020 at 6:19:55 PM UTC-6 Mark S. wrote:

> The angle braces REPLACE the square brackets in filter expressions. So 
> your code should look like:
>
> \define testme(parameter)
>   <$list filter="[tag<__parameter__>]">
>   <$link to=<>/>
>   
> \end
>
>
>
> On Wednesday, November 25, 2020 at 11:48:56 AM UTC-8 soren.b...@gmail.com 
> wrote:
>
>> On Wednesday, November 25, 2020 at 1:09:22 PM UTC-6 Mark S. wrote:
>>
>>> Inside a filter, a variable could be referenced as tag[$art$] or as 
>>> tag<__art__> .
>>>
>>
>> Really? Did that work for you? I thought parameters-as-variables only 
>> work in a strict transclusion context with double angle brackets. In a 
>> simple test it yields a syntax error:
>>
>> \define testme(parameter)
>>   <$list filter="[tag<__parameter__>]]">
>>   <$link to=<>/>
>>   
>> \end
>>
>> <>
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/f1430e06-a24f-4703-8b27-18f88c1a5908n%40googlegroups.com.


[tw5] Re: Tiddlername as tag

2020-11-26 Thread Gerald Weis
 

I have a tiddly with which I manage the IT equipment of the staff. 
There are also equipment tiddlers and personal tiddlers. 
The names of the devices are stored as tags in the person tiddlers. 
The names of the persons and the device classes are stored as tags in the 
device tiddlers. 
Now I would like to determine from the person tiddler which devices the 
person has. 
At the moment I have to enter the person name in the macro call, even 
though I have written the personal name exactly like the tag. 
I want to avoid that.
My macro call currently looks like this: 

<< person-device-a "person name" "device class" >>

The macro currently looks like this: 

```
\ define person-device-a (person class) 
 $class$
<$list filter = "[tag [$class$]sort[title]]+[tag[$person$]sort 
[title]]">

<$list filter="[tag[$person$]]+[tag [$class $]count[]]">


\end 
```


Mark S. schrieb am Donnerstag, 26. November 2020 um 01:19:55 UTC+1:

> The angle braces REPLACE the square brackets in filter expressions. So 
> your code should look like:
>
> \define testme(parameter)
>   <$list filter="[tag<__parameter__>]">
>   <$link to=<>/>
>   
> \end
>
>
>
> On Wednesday, November 25, 2020 at 11:48:56 AM UTC-8 soren.b...@gmail.com 
> wrote:
>
>> On Wednesday, November 25, 2020 at 1:09:22 PM UTC-6 Mark S. wrote:
>>
>>> Inside a filter, a variable could be referenced as tag[$art$] or as 
>>> tag<__art__> .
>>>
>>
>> Really? Did that work for you? I thought parameters-as-variables only 
>> work in a strict transclusion context with double angle brackets. In a 
>> simple test it yields a syntax error:
>>
>> \define testme(parameter)
>>   <$list filter="[tag<__parameter__>]]">
>>   <$link to=<>/>
>>   
>> \end
>>
>> <>
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/698240b5-029c-498c-ab68-399a9460ad26n%40googlegroups.com.


[tw5] Re: Tiddlername as tag

2020-11-25 Thread 'Mark S.' via TiddlyWiki
The angle braces REPLACE the square brackets in filter expressions. So your 
code should look like:

\define testme(parameter)
  <$list filter="[tag<__parameter__>]">
  <$link to=<>/>
  
\end



On Wednesday, November 25, 2020 at 11:48:56 AM UTC-8 soren.b...@gmail.com 
wrote:

> On Wednesday, November 25, 2020 at 1:09:22 PM UTC-6 Mark S. wrote:
>
>> Inside a filter, a variable could be referenced as tag[$art$] or as 
>> tag<__art__> .
>>
>
> Really? Did that work for you? I thought parameters-as-variables only work 
> in a strict transclusion context with double angle brackets. In a simple 
> test it yields a syntax error:
>
> \define testme(parameter)
>   <$list filter="[tag<__parameter__>]]">
>   <$link to=<>/>
>   
> \end
>
> <>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/6893ceb9-7f39-4978-9e9a-062fe6bdb875n%40googlegroups.com.


[tw5] Re: Tiddlername as tag

2020-11-25 Thread TW Tones
I am not sure why you are using <__parameter__>?

it is more for cases like paramname=<__parameter__>

The following works;

\define testme(parameter)
  <$list filter="[tag[$parameter$]]" emptyMessage="nothing tagged 
$parameter$">
  <$link to=<>/>
  
\end

<>

Tones
On Thursday, 26 November 2020 at 06:48:56 UTC+11 soren.b...@gmail.com wrote:

> On Wednesday, November 25, 2020 at 1:09:22 PM UTC-6 Mark S. wrote:
>
>> Inside a filter, a variable could be referenced as tag[$art$] or as 
>> tag<__art__> .
>>
>
> Really? Did that work for you? I thought parameters-as-variables only work 
> in a strict transclusion context with double angle brackets. In a simple 
> test it yields a syntax error:
>
> \define testme(parameter)
>   <$list filter="[tag<__parameter__>]]">
>   <$link to=<>/>
>   
> \end
>
> <>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2f1bd4e6-a61d-4375-84a4-ab728bfa6bf9n%40googlegroups.com.


[tw5] Re: Tiddlername as tag

2020-11-25 Thread soren.b...@gmail.com
On Wednesday, November 25, 2020 at 1:09:22 PM UTC-6 Mark S. wrote:

> Inside a filter, a variable could be referenced as tag[$art$] or as 
> tag<__art__> .
>

Really? Did that work for you? I thought parameters-as-variables only work 
in a strict transclusion context with double angle brackets. In a simple 
test it yields a syntax error:

\define testme(parameter)
  <$list filter="[tag<__parameter__>]]">
  <$link to=<>/>
  
\end

<>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e876e5a1-4896-431a-a497-f877c40e5ba9n%40googlegroups.com.


[tw5] Re: Tiddlername as tag

2020-11-25 Thread 'Mark S.' via TiddlyWiki
There was a lot of things going on in your code that I didn't understand. I 
assume that the current tiddler is the same as "person" ? You use "type" in 
the definition, but not in the code. And "art" in the code but not in the 
definition.

So I'm guessing you want something like the following. Note that you can 
reference a parameter as $art$ or as <<__art__>> in macro code. Inside a 
filter, a
variable could be referenced as tag[$art$] or as tag<__art__> .

Without a set of data, it's hard to test, but maybe this will help. 
Hopefully the new, wonderful GG editor doesn't insert spaces everywhere:

\define device-a(art)
 $art$
<$list filter="[tag<__art__>sort[title]]+[tagsort[title]]">

<>


<$list filter="[tag<__currentTiddler__>]+[tag[$art$]count[]]" >
<>


\end


<>


On Wednesday, November 25, 2020 at 2:25:26 AM UTC-8 Gerald Weis wrote:

> I have the following problem. In a tiddler I wrote the title exactly as I 
> did in the tag. Now I would like to insert the title as a tag name in a 
> macro. However, 
>
> ´´´
> <$ list [tag [<>]] + [tag [$ art $]]>
> ```
> does not work. at the moment my input looks like this. 
>
> ```
> << person-device-a "tiddler name" "geraeteart" >>
> ```
>
> Since there are several types of devices, the macro is called several 
> times. The macro currently looks like this. 
>
> ```
> \ define person-device-a (person type)
>   $ art $  
>  
> <$ list filter = "[tag [$ art $] sort [title]] + [tag [$ person $] sort 
> [title]]"> 
>  
> 
> <$ list filter = "[tag [$ person $]] + [tag [$ art $] count []]">  list>
>  
>  
> \end
> ```
>
> What I want is that I can save myself having to enter the tiddler name. Is 
> there a way to do this?
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/78bc199b-be0b-4c67-b780-82d37675ff6en%40googlegroups.com.