Attempting to promote a shadow tiddlers to a regular one

Hi,

I’m looking for help ‘unpacking’ shadow tiddlers.

I’ve read Export Discourse content as a CSV and import into TiddlyWiki after trying the following from [tw5] Re: Help to import .csv as separate tiddlers in Jsonmangler.

  • Can’t get this to work.
\define plugin-target() Data/vgsales
\define unpack-actions()
<$list variable="shadowtiddler" 
filter="[<plugin-target>indexes[/tiddlers]]">
<$action-setfield $tiddler=<<shadowtiddler>> 
$field="does.not.exit.in.this.wiki452369084306093845760894253" />
</$list>
\end

<$button actions=<<unpack-actions>> >
Press here to unpack <<plugin-target>>
</$button>

<$list variable="test" filter="[<plugin-target>indexes[/tiddlers]]">

</$list>

Thanks

SteveH

The following code reads all tiddlers from $:/plugins/tiddlywiki/internals plugin and adds a field modified with action-setfield widget

As soon as a shadow tiddler is modified, it will become a normal tiddler.

\procedure touch()
<$let shadowList={{{ [<name>plugintiddlers[]format:titlelist[]join[ ]] }}}>
	<$list filter="[enlist<shadowList>]" > 
		<$action-setfield modified=<<now "YYYY0MM0DD0hh0mm0ss">>/>
	</$list>
</$let>
\end

<$let name="$:/plugins/tiddlywiki/internals">

<$button actions=<<touch>> > Click Me </$button>

</$let>

More Background info can be found at:

Have fun!
Mario

test-touch.json (456 Bytes)

Hi Mario,

Thank you for your help and also for the extra references

I get an "Undefined widget ‘let’ error " . I’m guessing it’s because the version of the Jsonmangler tiddlywiki I’m using is a TW5, v2.2.5

\procedure touch() Undefined widget 'let' \end
Undefined widget 'let'

I persisted with the the first solution sourced from @Joshuafontany and managed to get it to work.

Regards SteveH

Hi Steve

You could use <$vars ... and </$vars> instead of $let

If you open the $:/ControlPanel, you can see the TW version. The $let-widget depends on the TW version.

Which version do you use?

Hi Mario,

The JsonMangler TW version is 5.1.23, while the ‘Empty Edition’ (with Bob), that I managed to get wirking with @joshuafontany’s solution is 5.2.3.

I did try $vars but that TW version also did not seem to appreciate the procedure statement.

SteveH

\procedure, \function, and \widget syntax were only introduced in TiddlyWiki v5.3.0 (July 1st, 2023)

For TiddlyWiki versions older than that:

  • Instead of \procedure somename(), use \define somename()
  • Instead of \function somename(), use \define somename()
    • then, within filter syntax, replace <somename> with subfilter<somename>
    • or, to display filter output (as plain text), use <$text text={{{ [subfilter<somename>] }}}/>
    • or, to save filter output in a variable, use <$wikify name="somevariable" text={{{ [subfilter<somename>] }}}>...</$wikify>
  • There is no equivalent for defining custom \widgets

-e

Thank you Eric

SteveH