Field names composed of variable and constant

86 views
Skip to first unread message

Gerald Weis

unread,
Nov 13, 2020, 4:13:53 AM11/13/20
to TiddlyWiki
 Hello friends The code below to create a tooltip label works. But the tooltips sometimes get longer so that the macro call becomes confusing. I want to change that.

\ define beztool (name tooltip)
<td align = left valign = top>
<$ button tooltip = $ tooltip $> $ label $ </ $ button>
</td>
\end

I have the following idea. Since I have a table in which there should be a lot of tooltips, this should be done with fields. The designations in the buttons are by necessity capital letters. now i would like the content of the box DescriptionIn lower case _ tooltip is read out and displayed as a tooltip. becomes. I've already tried the following.

\ define beztool (name)
<$ vars = "fieldname" value = lowercase [$ label $] _ tooltip>
<td align = left valign = top>
<$ button tooltip = $ fieldname $> $ description $ </ $ button>
</td>
\end

unfortunately that doesn't work. Can someone help me there?

thanks
Gerald

Gerald Weis

unread,
Nov 17, 2020, 7:40:22 AM11/17/20
to TiddlyWiki
Hello everybody
apparently that was incomprehensible what I wrote. I'll try again.
So I'm trying to recreate the structure of the registration of a vehicle. So that the whole thing doesn't get too broad, I've thought of the following.
1. The name of the field remains as it is in the approval.
2. The meaning of the field name is given in a tooltip.
so far the macro looks like this

\ define beztool (description tooltipname)
<td valign = top align = left>
<$ button class = "button" tooltip = {{!! $ tooltipname $ _tooltip}}> $ description $ </ $ button>
</td>
\end

So the following call is necessary so far.

<< beztool "A" "a" >>
<< beztool "P.2 / P.4" "p.2-p.4" >>

But I want to simplify the call. The writing for $ tooltipname $ should be omitted. The call should linger in the future

<< beztool "A" >>
<< beztool "P.2 / P.4" >>

In order for it to work like this, I would also replace the "/" character with another character that is allowed in the naming of fields.
For this it is necessary that the variable $ designation $ is transferred to a new variable and then transferred in lower case.

Is there a way to do this?
Thank you

TW Tones

unread,
Nov 17, 2020, 5:40:23 PM11/17/20
to TiddlyWiki
First question are you inserting spaces in your code?

It actually makes it harder to read for someone steeped in Wikitext.

If you just asked the question you require solved; the outcome you want - without wiki text which is adding complexity to your question, we may be able to help more. 

\define beztool(description tooltipname)
<td valign = top align = left>
<$button class="button" tooltip = {{!!$tooltipname$ _tooltip}}> $description$ </$button>
</td>
\end

References to above
Line 2: these values should be inside a style="" parameter with a different format?
Line 3: Inside the transclusion {{}} what is _tooltip ? the syntax it incorrect
Line 2-4: so we assume this macro is called from inside a tr or table row ?

  • Do persist, it becomes easier and we in the community love to help.
  • Also Gerald it you are fluent in another language perhaps provide your question in both English and your native language, perhaps someone here also speaks your language and can help.
Tones

Gerald Weis

unread,
Nov 18, 2020, 5:36:38 AM11/18/20
to TiddlyWiki
Hit Tones

line 2: i have tried it in css:
text-align:left; works,
vertical-align:top; dont works.

That is the reason for the html-tag.


line 3: the fieldname in the transclusion are composed form the variable $tooltip$ and the string _tooltip. It works.

My Input ist "A21", the fieldname ist "A21_tooltip". How must do i it correct?

Yes the macro is called in a table.
The tr-tag is entried in the table.
The macro show the Button in a table-cell.
beetween  2 td-tags will entried the value.

Macro show and value entry can be more then one in 1 table-row

tr-tag is ending the table-row
Reply all
Reply to author
Forward
0 new messages