Thank you so much! 

Here is the code I actually used:

tags = 
this.wiki.getTiddler(this.getVariable("currentTiddler")).getFieldString("tags");


See, I wasn't far off with my prediction of what the API would look like, 
just couldn't find it. Shame there's no reference, would have saved me a 
few hours.

Thanks again!

Kalcifer

On Monday, May 25, 2020 at 12:54:42 AM UTC+1, Joshua Fontany wrote:
>
> Also, once you return a tiddler, you can access all of its fields through 
> its `fields` property, like so:
>
> let tiddler = this.wiki.getTiddler(*title*);*let *tiddlerText = 
> tiddler.fields.text; //OR tiddler.fields["text"]
>
>
> The commented method allows you to get odd field names or to pass a 
> fieldname by reference/variable.
>
> Best,
> Joshua F
>
> On Sunday, May 24, 2020 at 4:51:55 PM UTC-7, Joshua Fontany wrote:
>>
>> If we look at the Button Widget code (among others) we can get 
>> tiddler-field data as a string thusly:
>>
>> this.wiki.getTiddler(this.setTitle).getFieldString(this.setField)
>>
>> If you don't know if the tiddler exits, there is a 
>> this.wikitiddlerExist() method to call, for example from the Link Widget:
>>
>> this.isMissing = !this.wiki.tiddlerExists(this.to);
>>
>>
>> Best,
>> Joshua F
>>
>>
>> On Sunday, May 24, 2020 at 4:16:13 PM UTC-7, Kalcifer Kandari wrote:
>>>
>>> I mean, the title explains it. Been looking through the source code 
>>> trying to find the answer.
>>>
>>> The macro I want to create is incredibly simple:
>>>
>>>    - Get the tags of the current tiddler.
>>>    - If one starts with 'feed--', return it.
>>>
>>> I thought it would be as simple as something like: 
>>> this.getTiddler("currentTiddler").field("tags"). Not quite so easy. I 
>>> got as far as discovering this.getVariable("currentTiddler"), not sure 
>>> what I can do with the just title though.
>>>
>>> Kalcifer
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/079ad7a1-ed9d-4a9c-9086-cf8ee854c9b1%40googlegroups.com.

Reply via email to