Pasting a field of one tiddler into a specific place of the text field of another tiddler?

56 views
Skip to first unread message

odin...@gmail.com

unread,
Nov 6, 2020, 6:43:43 AM11/6/20
to TiddlyWiki
I am struggling with making a UI to enter recipes. I am using $edit-text to make an input box. The inputs are stored into fields of temporary tiddlers. Now I want to paste the inputs into this code below in order to make the recipe easy to read.
____________________________________________________________
<div class="quote-recept">

{{$:/temp/Recepten/NieuwRecept!!recept-quote}}
</div>

<div class="ingredient">

{{$:/temp/Recepten/NieuwRecept!!recept-ingredienten}}
</div>

<div class="instruction">

{{$:/temp/Recepten/NieuwRecept!!recept-instructies}}
</div>

<br>

{{||Onderkant recept}} 
____________________________________________________________

(the onderkant recept is a tiddler that shows the portion amount and other metadata that is stored into fields.)
I know I can use $setfield inside a $button to set fields, I am using that one for the quote in the recipe, but also the portion size etc. The thing is, when I make a list in the input box like this:
*potato
*olive
*onion
the formatting is lost when it is placed into a field. It would then show up as *potato*olive*onion inline.

Another way I tried is to set the entire code above as a text field, but then the transclusion of the temporary tiddler doesn't happen. While the CSS is applied, it gets applied to {{$:/temp/Recepten/NieuwRecept!!recept-ingredienten}}, and not to the list
*potato
*olive
*onion 

What are some ways of pasting stuff from one tiddler into a specific part of another tiddler? 

TW Tones

unread,
Nov 6, 2020, 5:33:43 PM11/6/20
to TiddlyWiki
odin,

What you are doing below is not paste anything, you are transcluding. As soon as the temp tiddler/fields change it will be reflected .

  • Consider using the transclude widget <$transclude tiddler=$:/temp/Recepten/NieuwRecept field=recept-quote mode=block /> the block should render the content correctly
  • However this does not save the values 
    • Try a New tiddler button with entries such as recept-quote={{$:/temp/Recepten/NieuwRecept!!recept-quote}} as the parameters, so the temp values will be used to create the new tiddler.
    • Then simply use {{!!recept-quote}} to display the content of that field on the current tiddler. This can be placed in a tiddler tagged viewTemplate $:/tags/ViewTemplate

Regards
Tones

odin...@gmail.com

unread,
Nov 7, 2020, 10:46:33 AM11/7/20
to TiddlyWiki
TW tones,

Using the  <$transclude tiddler=$:/temp/Recepten/NieuwRecept field=recept-quote mode=block /> worked keeping the formatting that is entered into the textbox. This was the last piece I needed to make it work.

Thanks for the help!
Op vrijdag 6 november 2020 om 23:33:43 UTC+1 schreef TW Tones:
Reply all
Reply to author
Forward
0 new messages