I want to edit something, oh no that's a transclusion

354 views
Skip to first unread message

Ed Heil

unread,
Apr 30, 2020, 10:17:45 AM4/30/20
to TiddlyWiki
This is something that often happens to me: I want to update text in a tiddler, and when I get in there, I see that text is actually a {{transclusion}} -- possibly one I made using excision.  Now I have to remember what the name of the transclusion is, close the tiddler, go to the search bar, put in the name of the transclusion, find it and go edit it.

It feels like this is high-friction.  Am I missing something that would make it easier?

I seem to remember there's a built-in template which shows that something is a transclusion, that I maybe could use instead of plain transclusion.  I can't find it right now.  But I remember it was pretty loud/visually obtrusive and was not something I would want to use in most cases.

I could write my own transclusion template which includes the transcluded content, plus an unobtrusive link to the tiddler being transcluded, so I could quickly go there and edit it.  It just feels like this is a common enough problem that there might be a built-in solution I'm not aware of, and I thought I'd ask before rolling my own.

Mark S.

unread,
Apr 30, 2020, 10:36:17 AM4/30/20
to TiddlyWiki


This is a simple one that I use sometimes. I put this in a tiddler with a short name like "TE".

<$reveal state=<<qualify "TE">> type="nomatch" text="edit"><$transclude mode="block"/> <$button class="mybuttons" set=<<qualify "TE">> setTo="edit">Edit</$button>
</$reveal>
<$reveal state=<
<qualify "TE">> type="match" text="edit"><$transclude tiddler="$:/core/ui/EditTemplate" /> <$button class="mybuttons" set=<<qualify "TE">> setTo="show">Show</$button></$reveal>

Then when I make an excision, I add the template:

{{My excision||TE}}


I'm sure someone could come up with a better one. Like where all the text would be lightly highlighted until you clicked on it. That would be neat.

HTH

si

unread,
Apr 30, 2020, 11:16:12 AM4/30/20
to TiddlyWiki
I use this plugin which gives you a new macro for transclusion. I think the edit buttons appear when you hover over the transcluded text, but I have edited the CSS so they are always visible.

I'm interested to see what other solutions are out there.

Mohammad

unread,
Apr 30, 2020, 11:19:12 AM4/30/20
to TiddlyWiki
Added to TW-Scripts.

Peter Buyze

unread,
Apr 30, 2020, 11:22:35 AM4/30/20
to TiddlyWiki forum
In Ed's current situation, isn't the easy approach to open the "guest" tid in Edit mode to see which is the transcluded tid?

Anyway, I put a self-linking title at the top of each tid, like so

<$link><$view field="title"></$view></$link>

That way, when a tid is transcluded, that link is there too to open the transcluded tid.


--
Securely sent with Tutanota. Get your own encrypted, ad-free mailbox:


30 Apr 2020, 18:16 by matthew...@gmail.com:
--
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+...@googlegroups.com.

Mohammad

unread,
Apr 30, 2020, 11:36:01 AM4/30/20
to TiddlyWiki
Ed,
 Have a look for "Folding Editor" in TW-Scripts it is an elegant inline editor from Simon Huber!

--Mohammad

Mark S.

unread,
Apr 30, 2020, 1:17:53 PM4/30/20
to TiddlyWiki
It's a shame that he picked a lopsided syntax for that. The result is nice, but any
editor that wants to match curly braces is going to give crazy results.

Mark S.

unread,
Apr 30, 2020, 1:19:25 PM4/30/20
to TiddlyWiki
I guess what we need now is a revised excision tool that can insert the macro.

Diego Mesa

unread,
Apr 30, 2020, 3:25:16 PM4/30/20
to TiddlyWiki
I also use this excellent plugin - I think it should be a standard feature in TW!

Ed Heil

unread,
Apr 30, 2020, 3:42:40 PM4/30/20
to TiddlyWiki
These are all very helpful, thanks!

Inline editing of transcluded content is overkill as far as my needs are concerned -- I just want to visually identify what's transcluded and get to it easily.  I should be able to whip up a good simple solution from the ideas in this thread.

TonyM

unread,
Apr 30, 2020, 7:12:46 PM4/30/20
to TiddlyWiki
Ed,

If you are going to Role your own, this simple tip may help.

View Template buttons are designed to operate on the current tiddler. So if you transclude them allowing it to operate on the current tiddler they work.

{{||$:/core/ui/Buttons/edit}}

So if you generate a list and include this you will gain a little edit button that will open the current tiddler (in the list) if clicked

With transcluded content if you transclude as follows
{{External content}}

the transcluded tiddler is the current tiddler inside the transclusion.
So inside [[External content]] `{{||$:/core/ui/Buttons/edit}}` will make a button, if clicked, will edit "External Content" tiddler.

So if you make a global macro as follows
\define optional-edit()
<$list filter="[{$:/config/edit-mode}match[yes]]" variable=nul>
   
{{||$:/core/ui/Buttons/edit}}
</$list>
\end
and place <<optional-edit>>
at the bottom of your external content tiddlers, those transcluded in the original tiddler, the edit button will appear only if
{$:/config/edit-mode}match[yes]

I know this would be better with out the need to place something in the excised tiddlers, and I have a mechanism I discovered but needs more work. 
Its based on Parsing the output of https://tiddlywiki.com/#transclusion%20Variable

Regards
Tony

Ed Heil

unread,
May 1, 2020, 11:21:34 AM5/1/20
to TiddlyWiki
Hi Tony,

This is very neat.  That list widget doesn't seem to work for me though, I don't ever see the edit button if I put it inside that widget.

TonyM

unread,
May 1, 2020, 9:19:35 PM5/1/20
to TiddlyWiki
Ed,

I see that the list has a "variable=nul" this means each tiddler title is presented in the variable 
<<null>>

Yet the invocation of the edit button is to the current tiddler 

{{||$:/core/ui/Buttons/edit}}

So assuming all else is working remove the variable=nul

\define optional-edit()
<$list filter="[{$:/config/edit-mode}match[yes]]">

   
{{||$:/core/ui/Buttons/edit}}
</$list>
\end


Regards
Tony
Reply all
Reply to author
Forward
0 new messages