On Saturday, October 19, 2013 7:39:16 PM UTC-7, Anton Aylward wrote:

> Eric Shulman said 
>  > In TiddlyWiki Classic Clinic #3, I did a walk-through/demonstration 
>  > of "Using custom fields to create a simple database".  Unfortunately, 
>  > Clinice sessions #1 through #3 were *not* reccorded.  I could re-do 
>  > the same topic at a future Clinic session if you are interested. 
> Pity I missed it. 
> But would there be transcription/hardcopy *with* example* ? 
>

Sorry, no.  There was nothing written or recorded for the first three 
Clinic sessions.  However, I *CAN* do that same walkthrough again, 
especially if there's more interest in the topic.  To give you a start, 
here's a super-abbreviated lesson in using custom fields:

1) To create a custom input field in edit mode, add a line like this to 
EditTemplate:
   <div class='editor' macro='edit demo'>Please enter your comment 
here:</div>
   ("demo" is the custom field name, and must be all lower case, no spaces)

2) To display a custom field value in view mode, add a line like this to 
ViewTemplate:
   <div class='democlass' macro='view demo wikified'></div>
   (To display plain text without parsing, omit the keyword "wikified" is 
optional)

3) To style the display output, define ".democlass" CSS in StyleSheet:
   .democlass { border:1px solid gray; padding:1em; margin-top:1em; }
   (use whatever styles you like.)

note: the above changes will customize the view and edit modes for *all* 
tiddlers in the document.

4) To apply a custom template only for selected tiddlers, install:
   http://www.TiddlyTools.com/#TaggedTemplateTweak

5) Rename ViewTemplate and EditTemplate to "FoobarViewTemplate" and 
"FoobarEditTemplate"
   (all tiddlers evert to using the default shadow ViewTemplate and 
EditTemplate)

6) Tag a tiddler with "Foobar" and it will switch to using the custom 
"FoobarViewTemplate and "FoobarEditTemplate", allowing you to enter and 
display the custom fields defined by those templates.

7) To create a new tiddler that automatically uses the custom template, 
adds the necessary "Foobar" tag value, you can write:
   <<newTiddler ... template:'FoobarEditTemplate' tag:'Foobar' ... >>

Of course, you can have as many custom 
"SomethingViewTemplate/SomethingEditTemplate" pairs as you like, each with 
a different "Something" prefix.  This allows you to have multiple "type" of 
tiddlers in the same document.

.... and that's it.  The basics of "custom fields" in TiddlyWiki.

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 
"TiddlyWiki" 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/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to