I tried this:
<script label="L2T" title="List2Tags">
var here=store.findContainingTiddler(place);
if (!here) return;
var title=here.getAttribute("tiddler");
var tiddler=store.getTiddler(title);
var t=store.getTiddlerText(tiddler.title) ;
var target = store.getTiddler(tiddler.title) ;
var taglist = t.split('\n') ;
for(var i=0 ; i < taglist.length ; i++) {
if ( taglist[i] && ! target.tags.contains(taglist[i]) )
target.tags.push( taglist[i] ) ;
}
return 'Liste er overført til tags - klik redigér og færdig i
tiddleren' ;
</script>
And got this: TypeError: store.findContainingTiddler is not a function
when I tried to invoke it...
What am I doing wrong?
YS Måns Mårtensson
On 12 Apr., 19:29, Måns <[email protected]> wrote:
> TypeError: store.findContainingTiddler is not a function....
>
> On 12 Apr., 18:26, Eric Shulman <[email protected]> wrote:
>
> > > I'd like the script to be active in the tiddler it is invoked from.
> > > I thought that tiddler.title would do that for me - when I used the
> > > script from another tiddler with <<tiddler MyScript>>
> > > However it runs the script in the original tiddler instead (putting
> > > the script itself into the tagline!!)..
>
> > The 'tiddler' object that is provided by the core always refers to the
> > tiddler in which the wiki source is *stored* (the 'source tiddler'),
> > and is usually the same as the tiddler being *rendered* (the
> > 'containing tiddler'). However, when you use <<tiddler>> to
> > transclude content from a separate TiddlerName, the source tiddler is
> > different from the containing tiddler. In this case, in order to
> > ensure that you get the correct tiddler title and/or tiddler object,
> > you'll need to use the 'findContainingTiddler()' technique I
> > previously described:
>
> > var here=store.findContainingTiddler(place);
> > if (!here) return;
> > var title=here.getAttribute("tiddler");
> > var tiddler=store.getTiddler(title);
>
> > -e
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---