[Classic] Export User defined Fields

56 views
Skip to first unread message

RLM

unread,
Mar 3, 2017, 3:01:05 PM3/3/17
to TiddlyWiki
Anyone still work with Tiddlywiki Classic (2.8.1)?

I have a tiddlywiki with 500 tiddlers describing books in my Library. They are titled with the Title of the Book and there is a user defined field called author. I am trying to export all the books to an XML file.

I have installed exportTiddlerPlugin and have been able to customize the output to get the format I want for the standard fields (is there documentation on what %0, %1, etc map to?).

I have tried a number of things, but have not been successful. How would I add the author user defined field to the output?

Thanks for any help, pointers.

Randy

Dragon Cotterill

unread,
Mar 3, 2017, 7:45:01 PM3/3/17
to TiddlyWiki


On Friday, 3 March 2017 20:01:05 UTC, RLM wrote:
Anyone still work with Tiddlywiki Classic (2.8.1)?

Well yes, all my work is still in TWC.

In the normal export, the values for %0, %1 etc. change depending on which export option you selected. If you created your own export option, then it would be up to you to select the elements for export yourself.

I would suggest sticking to the methods which work as export and then process the resulting file into your XML. Exporting as .csv includes all the hidden custom fields on the tiddlers. It may not be elegant, but it'll get you a data format which you can then use outside of TW.

RLM

unread,
Mar 5, 2017, 9:33:02 AM3/5/17
to TiddlyWiki
Thanks for the hint. I was able to do exactly what I wanted.

In the formatItem function, I changed the line to

        if (f==this.type_TX)
            var r=this.plainTextTiddler.format([t.title, t.created.toLocaleString(), t.modified.toLocaleString(),
                t.modifier, String.encodeTiddlyLinkList(t.tags), t.text,t.fields['author']]);

This of course makes the author field parameter %6 and can be referenced in the go function, which can easily be modified to include the XML tags :

        +'<author>%6</author>\n'

Thanks again for pointing me in the right direction.
Reply all
Reply to author
Forward
0 new messages