tm-new-tiddler with title containing the title of another tiddler (in filter list)

62 views
Skip to first unread message

Alfalfa Scout

unread,
Apr 14, 2019, 2:59:57 PM4/14/19
to TiddlyWiki
What I'm trying to do:
Make a list of tiddlers that are missing certain pages from their tagging list, with a link to create the missing page.

For example, for every page titled 'Author Name', I want to know if I'm missing the page 'Books by Author Name' (tagged Author Name). If it's missing, I want the list to display a link to create that page from a template.

This is what I have so far.


These authors don't have a [[book list|Books by Generic Author]], or their list isn't tagged with their name.
<$list filter="[tag[Author]] -[tag[Author]tagging[Books by]tags[]]">

* <$view field="title"/> - Possible title: <$button tag="a" class="tc-btn-invisible tc-tiddlylink tc-tiddlylink-missing">
<$action-sendmessage $message="tm-new-tiddler" $param="Books by Generic Author" title="Books by {{!!title}}" />
Books by {{!!title}}
</$button>

</$list>


The list filter works fine, it shows me which pages tagged Author are missing book lists. The button looks fine and opens a new tiddler from the template just fine. What I cannot figure out, for the life of me, is how to make the action widget send the correct title message.


<$action-sendmessage ... title="Books by {{!!title}}" />
...uses the literal string, "Books by {{!!title}}" at which point the wiki warns me I shouldn't be using the characters { and } in the title.

<$action-sendmessage ... title="Books by <$view field='title'/>" />
... again just uses the string literally.

Putting a macro at the top, like
\define new-title() Scripts including {{!!title}}
and then using
<$action-sendmessage ... title=<<new-title>> />
... just spits out the literal "Books by {{!!title}}" again. I tried rephrasing macros and set widgets many ways but never got it to work.

<$action-sendmessage ... title=Books by {{!!title}} />
...without quotes only puts out 'Books' as the title.

I tried adding another filter with a prefix,
<$list filter="[title{!!title}addPrefix[Books by ]]">
<$action-sendmessage ... title={{!!title}} />
...but of course that doesn't work, because these pages don't exist so no titles are returned.

<$action-sendmessage ... title={{!!title}} />
... for frustrated good measure, this just gives the Author Name and then I'm editing the author's page instead of the book list page.

Does anyone know how to do this? Include a filter result in the title field along with other text?

Jed Carty

unread,
Apr 14, 2019, 3:20:51 PM4/14/19
to TiddlyWiki
The answer is filters.

This should work:

These authors don't have a [[book list|Books by Generic Author]], or their list isn't tagged with their name.
<$list filter="[tag[Author]] -[tag[Author]tagging[Books by]tags[]]">

<$set name=thisTitle filter=[[Books by ]addsuffix<currentTiddler>]'>


* <$view field="title"/> - Possible title: <$button tag="a" class="tc-btn-invisible tc-tiddlylink tc-tiddlylink-missing">
<$action-sendmessage $message="tm-new-tiddler" $param="Books by Generic Author" title=<<thisTitle>> />
Books by {{!!title}}
</$button>

</$set>

</$list>


Alfalfa Scout

unread,
Apr 14, 2019, 4:37:35 PM4/14/19
to TiddlyWiki
This didn't do quite what I wanted to do. It did open the correct tiddler name (finally) but didn't open it for editing and didn't include the template anymore.
I may never know why.

After reading many other threads on this forum that might be related, however, I found out there's a widget called <$wikify>: https://groups.google.com/forum/#!topic/TiddlyWiki/YjvIzNHAoLA

This seems to do exactly what I want it to do.

These authors don't have a [[book list|Books by Generic Author]], or their list isn't tagged with their name.
<$list filter="[tag[Author]] -[tag[Author]tagging[Books by]tags[]]">
<$wikify name="new-title" text="Books by {{!!title}}">


* <$view field="title"/> - Possible title: <$button tag="a"
class="tc-btn-invisible tc-tiddlylink tc-tiddlylink-missing">
<$action-sendmessage $message="tm-new-tiddler" $param="Books by Generic Author" title=<<new-title>> />
<<new-title>>
</
$button>
</$wikify>
</
$list>

Thank you to Jed Carty and TonyM for your help.

S. S.

unread,
Apr 14, 2019, 10:01:03 PM4/14/19
to tiddl...@googlegroups.com

Just as a note to the next person reading this post: As a general solution, Tiddler Titles should not be wikified.
The below might be a more robust:

\define new-title() Books by $(currentTiddler)$

\define makeTitle()
* <$view field="title"/> - Possible title: <$button tag="a" class="tc-btn-invisible tc-tiddlylink tc-tiddlylink-missing">
<$action-sendmessage $message="tm-new-tiddler" $param="Books by Generic Author" title="$(new-title)$" />
Books by $(currentTiddler)$
</$button>
\end


These authors don't have a [[book list|Books by Generic Author]], or their list isn't tagged with their name.
<$list filter="[tag[Author]] -[tag[Author]tagging[Books by]tags[]]">

<<makeTitle>>
</
$list>

Regards

Note: Cosmetic edits

Alfalfa Scout

unread,
Apr 14, 2019, 11:02:14 PM4/14/19
to tiddl...@googlegroups.com

Thanks! I tried this out and this works as well.

 

From: S. S.
Sent: Sunday, April 14, 2019 22:01
To: TiddlyWiki
Subject: [tw5] Re: tm-new-tiddler with title containing the title of anothertiddler (in filter list)

 


Just as a note to the next person reading this post: As a general solution, Tiddler Titles should not be wikified.
The below might be a more robust:

\define new-title() Books by $(currentTiddler)$

\define makeTitle()
* <$view field="title"/> - Possible title: <$button tag="a" class="tc-btn-invisible tc-tiddlylink tc-tiddlylink-missing">
<$action-sendmessage $message="tm-new-tiddler" $param="Books by Generic Author" title="$(new-title)$" />
Books by $(currentTiddler)$
</$button>

\end

These authors don't have a [[book list|Books by Generic Author]], or their list isn't tagged with their name.
<$list filter="[tag[Author]] -[tag[Author]tagging[Books by]tags[]]">

<<makeTitle>>
</
$list>


Regards


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/EwTun149NLc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c2d21dc1-07bb-4209-b0d9-c7503dbcbb08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

Reply all
Reply to author
Forward
0 new messages