On Monday, July 13, 2015 at 4:59:25 AM UTC-7, Henry Padilla wrote: > > <$button popup=<<qualify "cchPopupState">> > >{{$:/core/images/right-arrow}}</$button> {{!!title}} > <$reveal state=<<qualify "cchPopupState">> type="popup"> > <div class="tc-drop-down"> > {{!!cchSummary}} > </div> > </$reveal> > While I do get one and only one, summary, I can't control where it goes. > So it ends up at the top of the original tiddler. Which, considering the > list, can be quite a ways away. > First question: am I doing this right? Is there a way to get the > summaryPopup button to come from a macro and still be unique for each task > in the list? >
As you already learned, if the $button/$reveal popup/state value is literal text, then clicking any $button with popup="foo" opens *all* $reveals that have the matching state="foo". Using <<qualify "foo">> instead of just "foo" differentiates the 'id' by adding a calculated suffix to the popup/state value (e.g., "foo_123456789"), based on the position of the content within the "parse tree". This numerical suffix value is normally sufficient to create a unique id for each $button/$reveal you embed. However, when the $button/$reveal is generated as $list output, there is only ONE unique location in the parse tree (i.e., the macro definition itself), so even with the <<qualify "foo">> macro, the 'id' is the same for all items in the $list. To work around this, you need to generate a uniquely different popup/state 'id' for each and every task item in your list. One way to do this is to incorporate the {{!!title}} value for the current task item into the popup/state 'id'. Something like this should do the trick: \define id() <<qualify """cchPopupState_$item$""">> <$set name="item" value={{!!title}}> <$button popup=<<id>> >{{$:/core/images/right-arrow}}</$button> {{!!title}} <$reveal state=<<id>> type="popup"> <div class="tc-drop-down"> {{!!cchSummary}} </div> </$reveal> </$set> > Second: Am I using the $button/$reveal relationship correctly? I'm not > quite sure this is how to get done what I want. And I don't know what role > the "state" plays in the whole thing. > Your usage looks correct. The "popup" value in the $button has to match the "state" value in the $reveal, so that clicking that $button opens the corresponding $reveal(s) > Lastly: Is there a way to get the popup to originate at, or near, the > button it is related to? > If you create truly unique popup/state values for each $button/$reveal in your list, then the popup position will appear directly below the related button. You can adjust this placement using the position="..." parameter of the $button widget. hope this helps, enjoy, -e Eric Shulman ELS Design Studios TiddlyTools - "Small Tools for Big Ideas!" InsideTiddlyWiki: The Missing Manuals YOUR DONATIONS ARE VERY IMPORTANT! HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"... http://TiddlyTools.github.com/fundraising.html#MakeADonation Professional TiddlyWiki Consulting Services... Analysis, Design, and Custom Solutions: http://www.TiddlyTools.com/#Contact -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikidev+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywikidev@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywikidev. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/0e1f372b-0ff6-42a2-9ec9-a9a8b3c4d70b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.