[tw5] Struggling to nest a macro

2019-10-17 Thread Sycom
1Hello

If I get correctly what you're trying to do I'll recommend using the "variable" 
parameter of $list when you nest them. Maybe you can use else operator in your 
filter but the scope is limited.

Greetings

Sylvain
@sycom

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/72117f8f-45ef-4c44-82d1-cb42bbf0ff1b%40googlegroups.com.


[tw5] Struggling to nest a macro

2019-10-17 Thread Cade Roux
My existing macros allow me to present a transcluded tiddler with an (Edit) 
link after it and if the tiddler is missing, it presents it as (Missing), 
so that an editor can create and immediately the tiddler.

So I can do <>

and either get:

Transcluded tiddler content (Edit)

or

(Missing)

Now, I want to modify the macro so that it only puts those links in IF we 
are not in release mode (so casual users who are sent the file to read 
don't think they are editing anything).  But I know you can't nest macros 
and it also seems that you can't nest $list widgets?

These are my existing macros.  I tried to wrap the $list widget in 
trans-edit with another $list widget using a search on a "releasemode" 
tiddler, but it didn't seem to work.

\define trans-edit-btn(title)
(<$button class="tc-btn-invisible tc-tiddlylink">
<$action-createtiddler $basetitle="$title$" />
<$action-sendmessage $message="tm-edit-tiddler" $param="$title$"/>
Missing
)
\end

\define edit-btn(title)
(<$button class="tc-btn-invisible tc-tiddlylink">
<$action-sendmessage $message="tm-edit-tiddler" $param="$title$"/>
Edit
)
\end

\define trans-edit(title)
<$list filter="[title[$title$]] +[has[title]]" 
emptyMessage=<>>{{$title$}} <>
\end

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8325b80d-cb21-4588-abac-21607c83cbba%40googlegroups.com.