Can I set button popup param to a field instead of a tiddler?

128 views
Skip to first unread message

Vayu Asura

unread,
Jul 19, 2017, 12:28:10 PM7/19/17
to TiddlyWiki
Basicall I want to combine two examples from documentation:

this

<$button popup="$:/SamplePopupState">Pop me up!</$button>


<$reveal type="popup" state="$:/SamplePopupState">
<div class="tc-drop-down">


! This is the popup
And this is some text


</div>
</$reveal>

with this

<$reveal type="match" state="!!jeremy" text="tiddlywiki">
~TiddlyWiki!
</$reveal>

The problem is I can't find a way for a popup button parameter to reference a field:

<$button popup="!!jeremy">Pop me up!</$button>

does not work

I did manage to make a slider with SetField action but it is not a popup - you can't click on an area to hide it.

Mark S.

unread,
Jul 19, 2017, 12:52:54 PM7/19/17
to TiddlyWiki
Why do you care if the state needs a tiddler instead of a tiddler/field, since the contents are not available ? What is it that you're actually try to accomplish?

Good luck,
Mark

Vayu Asura

unread,
Jul 19, 2017, 2:55:01 PM7/19/17
to TiddlyWiki
I have a control that manipulates a <<toc>> type by RadioWidget field mode as a template. I have several <<toc>> macros throughout my document where I want that template. If I have two or more toc-tiddlers open in the story and click this control's popup button the popup would appear on all toc-tiddlers because the popup state tiddler is hard-coded into the template. If I could reference a field - the button would modify that field for the tiddler I'm using the template within. The only way around I can think of is to wrap the template into a macro and parametrize the popup state tiddler. 

PMario

unread,
Jul 19, 2017, 3:04:47 PM7/19/17
to TiddlyWiki

Vayu Asura

unread,
Jul 19, 2017, 3:27:12 PM7/19/17
to TiddlyWiki
Feels both neat and kludgy at the same time... Thanks, will try that!

myst...@gmail.com

unread,
Jul 19, 2017, 10:38:04 PM7/19/17
to TiddlyWiki
This is what i came up with to do essentially what you are suggesting:
This is from a DnD spell sheet selection.


\define choose_spell(field:nofield tags:"")
<$set name="myTidField" value="$(currentTiddler)$!!$field$">
<$button popup="$:/state/listpop" class="tc-dropdown-handle tc-btn-invisible">Pick</$button>
<$reveal type="popup" state="$:/state/listpop">
<div class="tc-drop-down">
<$list filter="[$tags$]">
<div class="tc-dropdown-item">
<$button set=<<myTidField>> setTo={{!!spell_name}} class="tc-btn-invisible">
<$view field="spell_name"/></$button>
</div>
</$list>
</div>
</$reveal>
</$set>
\end
Reply all
Reply to author
Forward
0 new messages