I am setting up some sort of documentmanagementsystem using tiddlywiki and I am quite satisfied with what I have this far. However, I would like to make a list of al tiddlers with a certain tag and their expiry date. For now I used foreachtiddlerplugin to generate a list of the tiddlers and their modified date, which is a substitute for their expiry date. Yet, I prefer to use an expiry date and would like to attach this to the tiddler using the datatiddlerplugin.
Probably I am a fool, but i don't understand how to do this.
For a given tiddler (test)I tried this:
<<t.setData("expdate","30-10-2014")
But then I get the message: Error in macro <<t.setData("expdate","30-10-2014")>>
What am I doing wrong? The plugin appears to be loaded correctly.
Hi!
If I'm not mistaken, you need the FormTiddlerPlugin to enter data.
Also, the reason you're getting the error is that t.setData isn't a
macro. Look at the site where you got the DataTiddlerPlugin for
examples.
w
On Oct 31, 4:15 pm, RV <rens.vingerho...@gmail.com> wrote:
> I am setting up some sort of documentmanagementsystem using tiddlywiki and
> I am quite satisfied with what I have this far.
> However, I would like to make a list of al tiddlers with a certain tag and
> their expiry date. For now I used foreachtiddlerplugin to generate a list
> of the tiddlers and their modified date, which is a substitute for their
> expiry date. Yet, I prefer to use an expiry date and would like to attach
> this to the tiddler using the datatiddlerplugin.
> Probably I am a fool, but i don't understand how to do this.
> For a given tiddler (test)I tried this:
> <<t.setData("expdate","30-10-2014")
> But then I get the message: Error in macro
> <<t.setData("expdate","30-10-2014")>>
> What am I doing wrong? The plugin appears to be loaded correctly.
And what I typed is more or less literally the example on how to "Set the value of the given data field of the tiddler to the value. When the value is undefined the field is removed."
Op woensdag 31 oktober 2012 20:20:29 UTC+1 schreef whatever het volgende:
> Hi! > If I'm not mistaken, you need the FormTiddlerPlugin to enter data. > Also, the reason you're getting the error is that t.setData isn't a > macro. Look at the site where you got the DataTiddlerPlugin for > examples.
> w
> On Oct 31, 4:15 pm, RV <rens.vingerho...@gmail.com> wrote: > > Hi guys,
> > I am setting up some sort of documentmanagementsystem using tiddlywiki > and > > I am quite satisfied with what I have this far. > > However, I would like to make a list of al tiddlers with a certain tag > and > > their expiry date. For now I used foreachtiddlerplugin to generate a > list > > of the tiddlers and their modified date, which is a substitute for their > > expiry date. Yet, I prefer to use an expiry date and would like to > attach > > this to the tiddler using the datatiddlerplugin.
> > Probably I am a fool, but i don't understand how to do this.
> > For a given tiddler (test)I tried this:
> > <<t.setData("expdate","30-10-2014")
> > But then I get the message: Error in macro > > <<t.setData("expdate","30-10-2014")>>
> > What am I doing wrong? The plugin appears to be loaded correctly.
> However, I would like to make a list of al tiddlers with a certain tag and
> their expiry date. For now I used foreachtiddlerplugin to generate a list
> of the tiddlers and their modified date, which is a substitute for their
> expiry date. Yet, I prefer to use an expiry date and would like to attach
> this to the tiddler using the datatiddlerplugin.
You can add custom fields to tiddlers without using any plugins at
all.
First, you need a way to enter the field....
To do this, you modify the [[EditTemplate]] to define a text input for
your custom field:
<div class='editor' macro='edit expirationdate'></div>
You can place the input field anywhere you like in the template. In
this case, I put it following the normal multi-line text input, like
this:
-----------------------
<!--{{{-->
<div class='toolbar' macro='toolbar
[[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit expirationdate'></div>
<div class='editor' macro='edit tags'></div><div
class='editorFooter'><span macro='message views.editor.tagPrompt'></
span><span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
-----------------------
Note: custom field names must be ALL LOWER CASE for the TWCore to
properly access them.
NEXT... you will probably want to be able to view the expiration date
when you *display* the tiddler. To do this, modify the
[[ViewTemplate]] by adding this line:
<div macro='view expirationdate'></div>
As with the EditTemplate change, you can place the field display
anywhere you like in the template. In this case, I put it in the
subtitle, following the normal modified/created date displays, and
included a bit of text surrounding it, like this:
(expires on: <span macro='view expirationdate'></span>)
----------------------
<!--{{{-->
<div class='toolbar' role='navigation' macro='toolbar
[[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span
macro='view modified date'></span> (<span macro='message
views.wikified.createdPrompt'></span> <span macro='view created
date'></span>)
(expires on: <span macro='view expirationdate'></span>)
</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
----------------------
Finally, and most important for your use-case... you will want to
access this field from within the <<forEachTiddler>> macro that you
are invoking. Within the fET context, you can reference the custom
fields of the current tiddler object by writing something like:
tiddler.fields['expirationdate']
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
> And what I typed is more or less literally the example on how to "Set the
> value of the given data field of the tiddler to the value. When the value is
> undefined the field is removed."
Note in the summary for DataTiddlerPlugin, it says:
...accessed and modified through named fields (in JavaScript
code)....
The examples that follow are Javascript... not macros. They are
intended to be used in the context of a forEachTiddler macro, or when
writing plugins or inline scripts (using my InlineJavascriptPlugin).
Something like this:
<script>
var t=store.getTiddler('NameOfTiddler');
t.setData(field,value);
</script>
OR, using the alternative "DataTiddler" methods (see DataTiddlerPlugin
documentation):
In any case, this may all be moot if you decide to use my alternative
non-plugin native TWCore template method for defining and accessing
custom fields.
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
> > However, I would like to make a list of al tiddlers with a certain tag > and > > their expiry date. For now I used foreachtiddlerplugin to generate a > list > > of the tiddlers and their modified date, which is a substitute for their > > expiry date. Yet, I prefer to use an expiry date and would like to > attach > > this to the tiddler using the datatiddlerplugin.
> You can add custom fields to tiddlers without using any plugins at > all.
> First, you need a way to enter the field....
> To do this, you modify the [[EditTemplate]] to define a text input for > your custom field: > <div class='editor' macro='edit expirationdate'></div> > You can place the input field anywhere you like in the template. In > this case, I put it following the normal multi-line text input, like > this: > ----------------------- > <!--{{{--> > <div class='toolbar' macro='toolbar > [[ToolbarCommands::EditToolbar]]'></div> > <div class='title' macro='view title'></div> > <div class='editor' macro='edit title'></div> > <div macro='annotations'></div> > <div class='editor' macro='edit text'></div> > <div class='editor' macro='edit expirationdate'></div> > <div class='editor' macro='edit tags'></div><div > class='editorFooter'><span macro='message views.editor.tagPrompt'></ > span><span macro='tagChooser excludeLists'></span></div> > <!--}}}--> > ----------------------- > Note: custom field names must be ALL LOWER CASE for the TWCore to > properly access them.
> NEXT... you will probably want to be able to view the expiration date > when you *display* the tiddler. To do this, modify the > [[ViewTemplate]] by adding this line: > <div macro='view expirationdate'></div> > As with the EditTemplate change, you can place the field display > anywhere you like in the template. In this case, I put it in the > subtitle, following the normal modified/created date displays, and > included a bit of text surrounding it, like this: > (expires on: <span macro='view expirationdate'></span>) > ---------------------- > <!--{{{--> > <div class='toolbar' role='navigation' macro='toolbar > [[ToolbarCommands::ViewToolbar]]'></div> > <div class='title' macro='view title'></div> > <div class='subtitle'><span macro='view modifier link'></span>, <span > macro='view modified date'></span> (<span macro='message > views.wikified.createdPrompt'></span> <span macro='view created > date'></span>) > (expires on: <span macro='view expirationdate'></span>) > </div> > <div class='tagging' macro='tagging'></div> > <div class='tagged' macro='tags'></div> > <div class='viewer' macro='view text wikified'></div> > <div class='tagClear'></div> > <!--}}}--> > ----------------------
> Finally, and most important for your use-case... you will want to > access this field from within the <<forEachTiddler>> macro that you > are invoking. Within the fET context, you can reference the custom > fields of the current tiddler object by writing something like: > tiddler.fields['expirationdate']
> enjoy, > -e > Eric Shulman > TiddlyTools / ELS Design Studios