> Does TW have methods for reading/writing to custom fields?

store.getValue(tiddler,fieldName)
* returns stored string value for the given fieldname
* returns undefined if fieldname does not exist

store.setValue(tiddler,fieldName,value)
* sets the value of the given field of the tiddler to the value
* fieldnames are case sensitive
* all values are converted and stored as strings
* use a value of null or undefined to remove the field.
* setting a namespace[1] to undefined removes all fields of that
namespace

[1] custom tiddler fields allow for "grouping" fields into
"namespaces" by adding a "spacename." prefix before the fieldname,
like this:
   store.setValue("SomeTiddler","somespace.foo","...");
   store.setValue("SomeTiddler","somespace.bar","...");
   store.setValue("SomeTiddler","somespace.baz","...");
The above code creates three custom fields, all starting with the same
"namespace" prefix.

For most uses, fieldnames that have a namespace prefix are handled the
same as other fields... the prefix is treat as just another part of
the fieldname.  However, in addition to simply setting/clearing values
by referencing the individual custom fields one at a time, like this:
   store.setValue("SomeTiddler","somespace.foo",null);
   store.setValue("SomeTiddler","somespace.bar",null);
   store.setValue("SomeTiddler","somespace.baz",null);
you can also use store.setValue(...) to clear an entire namespace in
one call, like this:
   store.setValue("SomeTiddler","somespace",null);

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
   http://www.TiddlyTools.com/#Donations

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
   http://www.TiddlyTools.com/#Contact

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to