Replacing button action with condition

Hi,

I’m using Saq’s Spotlight for an image gallery and this is activated by a button.

\define spotlight-actions()
<$action-spotlight
	$images=" "

	$start=""
	$labels=" "
	autoslide="true"
	class="fancycustomclass"
/>
\end

<$button actions=<<spotlight-actions>> >open lightbox</$button> 

Instead of a button, I’d like to open the gallery when a condition is met e.g.

<% if [<now DDD>match[Wednesday]]%>

<% endif %>

Is this possible?

Thanks
Jon

I don’t the spotlight action widget. However, maybe this might help:

https://tiddlywiki.com/#ActionNavigateWidget

Thanks, I did have a look at that but it seems to be based on a button click and that’s the action I want to replace.

That’s right. Just call it in your spotlight-actions() code (with your conditional, of course).

I am not sure if StartupActions may be what you want. But action-widgets can only be activated with user interaction.


I do have an experimental trigger-actions plugin, where the action is activated, whenever it is rendered.

Warning: It is possible to create endless loops if done wrong. – So Backup – Backup – Backup

\procedure test()
<!-- do something -->
\end

<$trigger actions=<<test>>/>

Just to clarify what I’m trying to do.

If I use Saq’s Swifty slider, I can put that in a tiddler called ‘Gallery autoplay’ and then I have a series of conditions, which once met from my data input during the week, will automatically open the tiddler and using $:/tags/AboveStory, the gallery will pop up above everything else.

<% if [<now DDD>match[Wednesday]]%>
...
...
...

{{Gallery autoplay}}

<% endif %>

So, this works fine but the Spotlight option would give a better result. It’s just the button activation is the problem.

At first glance, your plugin might be a bit advanced for me, but I’ll have a go and failing that, I can stick to the Swifty Slider option and work with that.

Thanks
Jon

Very basic user here :woozy_face:

Yea. This should probably do it. But I did not test it. As I wrote. Backup first.

<% if [<now DDD>match[Wednesday]]%>
  <$trigger actions=<<spotlight-actions>>/>
<% endif %>