Working with fields

124 views
Skip to first unread message

Jiri Pokorny

unread,
Sep 22, 2016, 2:13:46 PM9/22/16
to TiddlyWiki
Hi all,

I just can't figure this out. I want to do two things:

1) Edit the default template (or replace it) and add a set of custom fields that will be available everytime I edit any tiddler (so I don't have to remember them).
2) Adjust all tiddlers to display fields that have some content. I'd like that to be a table, pretty much the same as Info > Fields, so it should also display a name of the field, but not for empty fields.

Is that possible? 

Thanks!

PMario

unread,
Sep 23, 2016, 4:27:47 AM9/23/16
to TiddlyWiki
On Thursday, September 22, 2016 at 8:13:46 PM UTC+2, Jiri Pokorny wrote:
1) Edit the default template (or replace it) and add a set of custom fields that will be available everytime I edit any tiddler (so I don't have to remember them).

There is no need ot edit templates. You just need a button the creates a new tiddler, that chontains the fields, that you want. -> done. See code below.
 
2) Adjust all tiddlers to display fields that have some content. I'd like that to be a table, pretty much the same as Info > Fields, so it should also display a name of the field, but not for empty fields.


add 1)

More info at: http://tiddlywiki.com/#WidgetMessage%3A%20tm-new-tiddler

<$button>
<$action-sendmessage $message="tm-new-tiddler" title="This is newly created tiddler" tags="OneTag [[Another Tag]]" text=<<now "Today is DDth, MMM YYYY">> field1="test" field2=""/>
New Tiddler
</$button>


add 2)
That's a bit trickier. .. Attachment will follow.

have fun!
mario

PMario

unread,
Sep 23, 2016, 4:56:31 AM9/23/16
to TiddlyWiki
add 2)

Drang and drop import these tiddlers. It contains:

_my/ui/Tiddler/CustomFields ... That tiddler is tagged: $:/tags/ViewTemplate so it will be added to every Tiddler

_my/ui/NewTiddlerButton ... contains the "new tiddler" button

_my/ViewTemplate/CustomFields/ElementTemplate ... template for one row in the table

_my/ViewTemplate/CustomFields ... template that defines the table. This one can be used to change the filter:

see: <$list filter="[all[current]fields[]sort[title]] -text -title -tags -created -creator -modified -modifyer" ...
You can see that eg: -text field is excluded.

-------
Important:

  • If you don't want to see those tiddlers in the recent list. Just add $:/  in front of the tiddler names.
  • You'll need to add $:/ everywhere, where it is used, nut just the titles!!!

have fun!
mario



_my-ui-show-custom-fields-view-template.json

Jiri Pokorny

unread,
Sep 23, 2016, 7:37:24 AM9/23/16
to TiddlyWiki
Great! Thank you very much!

PMario

unread,
Sep 23, 2016, 8:52:22 AM9/23/16
to TiddlyWiki
On Friday, September 23, 2016 at 1:37:24 PM UTC+2, Jiri Pokorny wrote:
Great! Thank you very much!

You are welcome! ... Let us know, if you have something online :)
-m
Reply all
Reply to author
Forward
0 new messages