Here's the example I'm referring to:
<html>
<sub><b>Title:</b></sub><br/><input name=title type=text/>
</html>
<<newTiddler label:"Create new storyline"
template:ViewTemplate
title:{{store.getTiddler("Storylines").data("title")}}
text:{{store.getTiddlerText("StoryTemplate")}}
tag:"storyline">>
And here's my breakdown of what I think I understand, and what I know
I don't understand.
First the text field:
<html>
<sub><b>Title:</b></sub><br/><input name=title type=text/>
</html>
I assume the HTML text box is where you would put the title for the
new tiddler that will be created with the form.
Next:
<<newTiddler label:"Create new storyline" // I understand this is a
label for the newtiddler button
template:ViewTemplate // And I believe this is a call to the
ViewTemplate, as opposed to the EditTemplate which would cause the new
tiddler to open in View mode, which is what I want to have happen.
title:{{store.getTiddler("Storylines").data("title")}} //
This line I don't understand...What are "Storylines" and "title"?
text:{{store.getTiddlerText("StoryTemplate")}} // I think I
understand this line is where you call the form that you want the new
tiddler to be based upon
tag:"storyline">> // and this is the predefined tag
Finally, in order to use Saq's js code that he provided in the thread
referred to above, is that just pasted in as a new tiddler called
NewSavedTiddler and tagged as systemConfig?
~Rex
Finally, in order to use Saq's js code that he provided in the thread
referred to above, is that just pasted in as a new tiddler called
NewSavedTiddler and tagged as systemConfig?
I am interested in doing what your are, but I will have to wait for an
answer too. However I think the javascript creates a button that
implements with this: <<newSavedTiddler>> That will bring up a text
box with the prompt "Create a new saved tiddler" I have now expended
all my knowledge on this subject but it may help you.
Morris Gray
http://twhelp.tiddlyspot.com
A TiddlyWiki help file for beginners
On Oct 16, 3:44 pm, Rex <rexwalter...@yahoo.com> wrote:
> I was using the NewTiddlerWithForm macro with Udo's FormTiddlerPlugin
> when I came across this thread:http://groups.google.com/group/TiddlyWiki/browse_thread/thread/3098a7...
This is the root of the problem: when not using EditTemplate in the
newTiddler macro (*), tags and text are ignored. That's why Saq
created a new macro, <<newSavedTiddler ...>>
(*) This a simplification. According to http://tiddlywiki.com/#NewTiddlerMacro
You can only prime the initial values of fields that map to a text
input box in the specified template (for instance, if you specify the
standard ViewTemplate as the template you won't be able to prime any
fields). For example, this doesn't work as you might expect:
<<newTiddler template:ViewTemplate text:"To be or not to be">>
Hmmm... I just tried that and it still didn't work. The macro just
opens a new blank tiddler in view mode, rather than a new tiddler with
my formTiddler Template ready to be filled in.
~Rex
On Oct 16, 5:17 am, Xavier Vergés <xver...@gmail.com> wrote:
> > template:ViewTemplate // And I believe this is a call to the
> > ViewTemplate, as opposed to the EditTemplate which would cause the new
> > tiddler to open in View mode, which is what I want to have happen.
>
> This is the root of the problem: when not using EditTemplate in the
> newTiddler macro (*), tags and text are ignored. That's why Saq
> created a new macro, <<newSavedTiddler ...>>
>
> (*) This a simplification. According tohttp://tiddlywiki.com/#NewTiddlerMacro
In a tiddler titled "Add OfflineMedia" I've put the following:
<html>
<sub><b>Title:</b></sub><br/><input name=title type=text/>
</html>
<<newTiddler
label:"try this"
prompt:"tooltip"
template:MyCustomViewTemplate
title:{{store.getTiddler("Add OfflineMedia").data("title")}}
text:{{store.getTiddlerText("AddMedia")}}
tag:offlineMedia>>
I also created three other tiddlers that I think are supposed to come
into play: MyCustomViewTemplate, AddMedia and OfflineMediaTemplate
MyCustomViewTemplate = I copied the contents of the ViewTemplate into
a new tiddler named MyCustomViewTemplate
AddMedia = This is the tiddler where I put the <<formTiddler
OfflineMediaTemplate>> macro as well as the <data>{...}</data> fields
associated with the form. The AddMedia tiddler displays the form
created in OfflineMediaTemplate just fine.
OfflineMediaTemplate = Of course, this is the form I want to use for
the data entry.
When I click on the "try this" button in the Add OfflineMedia tiddler
to fire the macro, it just opens a new blank tiddler, only it opens in
view mode, rather than edit mode.
~Rex
Where can I view some examples of customized view templates to get an
idea how to set one up for my form? This seems like such a powerful
feature, so I'm kind of surprised that I'm not finding more
information about how to create custom templates. I'm probably
looking in the wrong places.
~Rex
what features are you missing if you use NewTiddlerWithForm or the
<<newSavedTiddler ...>> defined in the attached code in the thread
that you referenced in the initial post?
I think that the <<newSavedTiddler ...>> should give you anything that
you need...
Probably something like the next tiddler should work
==Add OfflineMedia==
/% This will have the value in the input field %/
<data>{}</data>
/% A part just to avoid having an additional tiddler with the form
template %/
<part FormTemplate hidden>
<html>
Title: <input name="title"><br/>
</html>
</part>
/% Show the form where the title is selected %/
<<formTiddler [[Add OfflineMedia/FormTemplate]]>>
/% A button to create a tiddler that uses the OfflineMediaFormTemplate
with some prefilled values
{{}} causes the macro params to be eval'ed
DataTiddler.getData gives access to the <data> section above
%/
<<newSavedTiddler
label:"try this"
prompt:"tooltip"
title:{{DataTiddler.getData("Add OfflineMedia","title")}}
text:{{'<data>{"mediaTitle":' + DataTiddler.getData("Add
OfflineMedia","title")+
'</data><'+'<formTiddler OfflineMediaFormTemplate>'+'>'}}
tag:offlineMedia>>
-Xv
<<newSavedTiddler label:"Add Reference to Offline Media"
template:ViewTemplate
text:{{store.getTiddlerText("AddMedia")}}
tags:"offlineMedia">>
I get prompted for a title, then the form I created opens up in view
mode and whatever data I enter in the form gets saved and tagged. I'm
not sure a hacker like me could ask for anything more :)
BTW, I did try the tiddler you suggested, but I kept getting an error
message and I don't understand js enough yet to decipher the error.
~Rex
Nice!
> BTW, I did try the tiddler you suggested, but I kept getting an error
> message and I don't understand js enough yet to decipher the error.
Nevrmind. Simpler (yours) is better. And I did not understand what you
were after.
Saq, how about moving the newSavedTiddler macro from an attachment to
http://tw.lewcid.org/sandbox/ ?
-Xv
-Xv
) : a gallery of TiddlyWiki themes.
TiddlySnip ( http://tiddlysnip.com ) : a firefox extension that turns TiddlyWiki into a scrapbook!
LewcidTW ( http://tw.lewcid.org ) : a repository of extensions for TiddlyWiki