Creating a custom form in edit/view template

513 views
Skip to first unread message

Nicolas Syssoieff

unread,
Feb 18, 2008, 5:40:46 AM2/18/08
to tiddlywiki
Hi all,

A probably very simple question :
In this help page (http://tiddlywiki.org/wiki/HideWhenPlugin_questions) it explains how you can create custom fields in both viewtemplate and edittemplate.

My problem is that I can successfully see them both (in edit mode, a field input waiting for something, in view mode, the "Food:" label, as proposed in the example), but whatever I input in edit mode, I do not see it while rendering the tiddler in view mode seconds later.

Technically, I have this in the edittemplate :
<div macro="showWhen tiddler.tags.contains('test')">
  Food: <span macro="edit favouriteFood"></span>
</div>

And this in the viewtemplate :
<div macro="showWhen tiddler.tags.contains('test')">
  Food: <span macro="view favouriteFood"></span>
</div>

Can anyone explain what I'm missing here ?

Thanks
Nicolas

P.S. Is it the same protocol for a checkbox that would apply a tag ? Can I just insert a <span macro="toggleTag tagName . 'tagName'"></span> line in the same div, and have, in the edittemplate, checking this box automatically tag or untag the tiddler with tagName ?

Eric Shulman

unread,
Feb 18, 2008, 6:55:49 AM2/18/08
to TiddlyWiki
> My problem is that I can successfully see them both (in edit mode, a field
> input waiting for something, in view mode, the "Food:" label, as proposed in
> the example), but whatever I input in edit mode, I do not see it while
> rendering the tiddler in view mode seconds later.
>
> Food: <span macro="edit favouriteFood"></span>
>
> Can anyone explain what I'm missing here ?

custom field names MUST be *all lower case*

see this ticket for details:
http://trac.tiddlywiki.org/ticket/356

-e
Eric Shulman
TiddlyTools / ELS Design Studios

Nicolas Syssoieff

unread,
Feb 18, 2008, 8:27:28 AM2/18/08
to Tiddl...@googlegroups.com
Hi Eric,

This was a tricky one, I was looking everywhere but in this direction :)
Thanks, it works now.

Nicolas.
Reply all
Reply to author
Forward
0 new messages