What is this weird error in "define"?

102 views
Skip to first unread message

Mike Andyl

unread,
Jul 4, 2021, 8:41:42 AM7/4/21
to TiddlyWiki
I want to make a list of pictures with an address.
https://i.imgur.com/zRhtrSo.jpg

\define image-picker2(actions,filter:"[all[tiddlers+shadows]tag[$:/tags/Image]]",subfilter:"")
<div class="tc-image-chooser">
<$vars state-system=<<qualify "$:/state/image-picker/system">>>
<$reveal type="match" text="hide" default="hide" tag="div">
<$macrocall $name="image-picker-list" filter="""$filter$""" actions="""$actions$"""/>
</$reveal>
<$reveal state=<<state-system>> type="nomatch" text="hide" default="hide" tag="div">
<$macrocall $name="image-picker-list" filter="""$filter$""" actions="""$actions$"""/>
</$reveal>
</$vars>
</div>
\end

<$button message="tm-open-external-window" param={{!!url}}>Источник</$button><br>

* {{!!url}}
* https://tiddlywiki.com/#image-picker%20Macro
<hr>

<$edit-text tiddler='$:/_MyImage' tag='input' placeholder='(unset)' default=''/>

<$transclude tiddler={{$:/_MyImage}}/>

---
<$macrocall $name='image-picker2' actions="
<$action-setfield $tiddler='$:/_MyImage' $value=<<imageTitle>>/>
"/>


But if you add something to the beginning, then everything breaks down!
https://i.imgur.com/6zb4df6.jpg

And even the old code doesn't work anymore. Why? What am I doing wrong?

Soren Bjornstad

unread,
Jul 4, 2021, 9:38:25 AM7/4/21
to TiddlyWiki
That's just how macros work in TiddlyWiki. Any pragmas (things beginning with a \), including \define, have to come before all non-pragma content in a tiddler.

Mike Andyl

unread,
Jul 4, 2021, 5:04:23 PM7/4/21
to TiddlyWiki
And this shouldn't be restored if I canceled the changes and removed all the extra symbols before?

воскресенье, 4 июля 2021 г. в 16:38:25 UTC+3, Soren Bjornstad:

PMario

unread,
Jul 5, 2021, 7:00:06 AM7/5/21
to TiddlyWiki
On Sunday, July 4, 2021 at 11:04:23 PM UTC+2 miket...@gmail.com wrote:
And this shouldn't be restored if I canceled the changes and removed all the extra symbols before?

It will be restored, if you changed it back to the initial state. If not it may be a bug, or you copy pasted some invisible character from the web above the \define statement.

-mario

Mike Andyl

unread,
Jul 5, 2021, 8:44:08 AM7/5/21
to TiddlyWiki
No, it is not restored and does not work anymore, there are no symbols.
https://i.imgur.com/TDvEgac.jpg
понедельник, 5 июля 2021 г. в 14:00:06 UTC+3, PMario:

PMario

unread,
Jul 5, 2021, 9:44:49 AM7/5/21
to TiddlyWiki
Hi,
It would be much easier, if you posted the code, instead of images. I can test the code with a wiki, but I have to test the code from an image in my brain, which makes it much more difficult ... for me.

You didn't show the the code for "image-picker-list", which seems to contain the button, which doesn't work.

-mario
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Mike Andyl

unread,
Jul 5, 2021, 2:40:07 PM7/5/21
to TiddlyWiki
I attached the code for it in the first post.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages