[tw] Re: Dropzone issue
On Saturday, July 15, 2017 at 7:21:07 AM UTC-7, mervin mecklenburg wrote: > > I want to make a dropzone that tags the action tiddler, or the tiddler > dragged into the dropzone, with the title of the tiddler hosting the drop > zone. The solution I have created works unless the proposed tag has more > than one word; then each word presents as a separate tag; ie, if the > hosting tiddler is entitled "DropZone" my solution works fine, but if the > title is "Drop Zone," then two tags are produced, "Drop" and "Zone." I need > the entire title to be one tag. > > > Here is an example of my code: > > > \define droppable-projectnotes() <$action-listops > $tiddler=<> $tags="+[append]"/> \end > The parameter for the append[...] list-ops filter expects a *list* of values to add. As a result, spaces are treated as separators between individual tags "Drop" and "Zone". Try using the insertbefore[...] filter instead: http://tiddlywiki.com/#insertbefore%20Operator. As noted in the documentation, if you do not specify the "B" (before) tiddler as a suffix, the new value is added to the *end* of the list. Something like this: <$action-listops $tiddler=<> $tags="+[insertbefore< currentTiddler>]"/> Let me know how it goes. enjoy, -e Eric Shulman TiddlyTools.com: "Small Tools for Big Ideas" (tm) InsideTiddlyWiki: The Missing Manuals -- 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/462b214e-eafc-4fb6-b43d-99e22e3657e4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: Dropzone issue
I'm still struggling with this. I tried your suggestion, but the "Insertbefore" is not giving me a return. Here is a copy of the relevant code using the listbefore operand: \define droppable-projectnotes() <$action-listtops $tiddler=<> $tags="+[insertbefore] \end <$droppable actions=<>>{{$:/core/images/copy-clipboard}}AddProjectNotes I as not able to find any examples in the documentation of the listbefore operand being used. Perhaps I am missing something. Do you have any suggestions. I appreciate all of the suggestions I get from this forum, and I find much in this forum helpful. Merv On Saturday, July 15, 2017 at 9:25:58 AM UTC-6, Eric Shulman wrote: > > On Saturday, July 15, 2017 at 7:21:07 AM UTC-7, mervin mecklenburg wrote: >> >> I want to make a dropzone that tags the action tiddler, or the tiddler >> dragged into the dropzone, with the title of the tiddler hosting the drop >> zone. The solution I have created works unless the proposed tag has more >> than one word; then each word presents as a separate tag; ie, if the >> hosting tiddler is entitled "DropZone" my solution works fine, but if >> the title is "Drop Zone," then two tags are produced, "Drop" and "Zone." I >> need the entire title to be one tag. >> >> >> Here is an example of my code: >> >> >> \define droppable-projectnotes() <$action-listops >> $tiddler=<> $tags="+[append]"/> \end >> > > The parameter for the append[...] list-ops filter expects a *list* of > values to add. As a result, spaces are treated as separators between > individual tags "Drop" and "Zone". > > Try using the insertbefore[...] filter instead: > http://tiddlywiki.com/#insertbefore%20Operator. As noted in the > documentation, if you do not specify the "B" (before) tiddler as a suffix, > the new value is added to the *end* of the list. Something like this: > > <$action-listops $tiddler=<> $tags="+[insertbefore< > currentTiddler>]"/> > > Let me know how it goes. > > enjoy, > -e > Eric Shulman > TiddlyTools.com: "Small Tools for Big Ideas" (tm) > InsideTiddlyWiki: The Missing Manuals > -- 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/90892893-bd88-4154-ab67-22f44f86c27c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: Dropzone issue
Hi Merv Here’s an example how I use action listops for something similar: I use the same button to add and remove tags by either specifying the tag in the attribute "add" or in "remove". In a $set widget I define a variable called "subfilter" that puts double brackets around the tag to add/remove. \define teBtnTagAddRemove(btntext,add:"_false_",remove:"_false_",class:"",tiddler:"_false_") <$vars tiddler="""$tiddler$""" btnclass="te-popup-action $class$" add="""$add$""" remove="""$remove$"""> <$set name="actiontid" filter="[!prefix[_false_]]" value=<> emptyValue=<>> <$set name="subfilter" filter="[!prefix[_false_]]" value="[[$add$]]" emptyValue="-[[$remove$]]"> <$wikify name="at" text=<>> <$button class=<>> <$action-listops $tiddler=<> $field="tags" $subfilter=<>/> <$text text="""$btntext$"""> \end I have removed some additional complexity not relevant for your case, I hope you get the main part. Maybe this helps. Cheers, Thomas -- 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/087164bf-b87d-4634-ba13-963ade2f5834%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: Dropzone issue
On Sunday, July 16, 2017 at 8:17:25 AM UTC-7, mervin mecklenburg wrote: > > I'm still struggling with this. I tried your suggestion, but the > "Insertbefore" is not giving me a return. > > Here is a copy of the relevant code using the listbefore operand: > > \define droppable-projectnotes() <$action-listtops > $tiddler=<> $tags="+[insertbefore] \end > <$droppable > actions=<>>{{$:/core/images/copy-clipboard}}AddProjectNotes > > some possible reasons it's not working: 1) TYPO "$action-listtops" should be "$action-listops" (one "t") 2) SYNTAX "\end" is only needed for multi-line macro definitions (where the \end occurs on a line by itself) let me know if that makes any difference -e -- 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/fb9fce3c-b444-418a-ae1a-53eb91ae7e2f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.