[tw] Re: FET "write" without the FET?

2009-03-03 Thread Dave Parker

Hi Eric, thanks for that script.  I'm going with:


return "+++[.] [[notes"+tiddler.title+"]] <>===";


because I can just plunk it in to any tiddler and the Notes tiddler
for that is already there to click on (just empty at first)

Here's the twist I'm not sure how to get around:

The small tiddler this script is in, is itself part of a larger
tiddler that is including (via <>) it.  And, to
boot, I'm using Saq's TiddlerWithEdit plugin that allows me to double
click on the "included" small tiddler within the bigger one and go to
edit the small one directly.  So when I click on the note for that
small tiddler I can add notes to it and see it there, but when I go
back to the bigger tiddler and view it, the same script in that one
thinks "tiddler.title" is referring to that big tiddler and not the
original small one.

any suggestions?

thanks again,
Dave

On Mar 3, 11:12 am, Eric Shulman  wrote:
> > 
> > write
> >  '"+++[.] [[notes"+tiddler.title+"]]"+"< > "+"[[notes"+tiddler.title+"]]"+"\>\>==="'
> > 
>
> > the error I get is:
> > ReferenceError: write is not defined
>
> There are several ways to render the output from an inline script.
> The easiest method is to simply *return* the wiki-formatted text that
> you want to have rendered, like this:
>
> 
> return "+++[.][[notes"+tiddler.title+"]]< [[notes"+tiddler.title+"]]>>===";
> 
>
> Note: for simple substitutions of values such as "tiddler.title", you
> could also just use the <> macro with a computed parameter...
>
> First, create the tiddler to be transcluded (e.g., [[AddNotes]]), with
> content like this:
>    +++[.][[notes$1]]<>===
>
> Then, embed it in other tiddler content like this:
>    <>
>
> When rendered from a tiddler called "FooBar", this will produce:
>    +++[.][[notesFooBar]]<>===
>
> QED.
>
> enjoy,
> -e
> Eric Shulman
> TiddlyTools / ELS Design Studios
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to TiddlyWiki@googlegroups.com
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/TiddlyWiki?hl=en
-~--~~~~--~~--~--~---



[tw] Re: FET "write" without the FET?

2009-03-03 Thread Eric Shulman

> 
> write
>  '"+++[.] [[notes"+tiddler.title+"]]"+"< "+"[[notes"+tiddler.title+"]]"+"\>\>==="'
> 
>
> the error I get is:
> ReferenceError: write is not defined

There are several ways to render the output from an inline script.
The easiest method is to simply *return* the wiki-formatted text that
you want to have rendered, like this:


return "+++[.][[notes"+tiddler.title+"]]<>===";


Note: for simple substitutions of values such as "tiddler.title", you
could also just use the <> macro with a computed parameter...

First, create the tiddler to be transcluded (e.g., [[AddNotes]]), with
content like this:
   +++[.][[notes$1]]<>===

Then, embed it in other tiddler content like this:
   <>

When rendered from a tiddler called "FooBar", this will produce:
   +++[.][[notesFooBar]]<>===

QED.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to TiddlyWiki@googlegroups.com
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/TiddlyWiki?hl=en
-~--~~~~--~~--~--~---