Transclusion is a mystery (just trying to show content)

Hi Folks,

Transclusion failure - ,… I tried the following (I don’t really understand them)


I have Tiddlers and they don’t seem to show the contents.

Tiddler - “A” - than has:

Field: “Value”
“Value”: my/book title/Cat in the Hat (The)

Tiddler “B” - that has:

Body Text: {{!!Book_Value}}
Field: “Book_Value”
“Book_Value”: /Purchase/{{A!!Value}}/Content/Note

Tiddler: “/Purchase/my/book title/Cat in the Hat (The)/Content/Note”

Body Text:
Book: Cat in the Hat (The)
Author: Dr. Seuss
Summary: My kids enjoyed this


I am trying to get Tiddler “B”'s Text to show the contents of Tiddler “A”'s Field

  • Tiddler A’s field is the actual path to the Tiddler I need (in this case Cat in the Hat (The)
    • But changes based on how I set the field
  • I tried different transclusions - but I only see the “path” to the tidder in “B”'s Body Text - and not the actual Tiddler


Any idea’s - I am stuck - and have been at this for about 4 hours,…

Thanks,

TwN00b

Gosh, this feels really convoluted. [EDIT/UPDATE: skip ahead to my best interpretation of your core challenge and solution]

I admit I don’t follow exactly what you’re trying to do. But transclusion should be straightforward, and should not involve specifying paths to tiddlers with transcluded bits in the middle of the path.

I assume you’re using node.js or something, which leads you to have this preoccupation with paths? And I admit I’m not a node.js user… But I doubt that node.js projects need to complicate things in the way you’re doing here. node.js is a different way of getting TiddlyWiki up and running, but it doesn’t require a whole alternate way of addressing tiddlers (right, folks??).

Also, there are quote marks here and there in both your field names and values, and I don’t understand why.

Particularly suspicious, to me, is this bit:

“Book_Value”: /Purchase/{{A!!Value}}/Content/Note

If you have a Book_Value field (not a “Book_Value” field) in Tiddler_A, you should be able to get Tiddler_B it to display this value (from Tiddler_A) simply, with {{Tiddler_A!!Book_Value}}

But you seem to be trying to plug that value into a more complex path-like string. Such computed compound strings are possible (appending tiddler names at the end of external urls for external wikipedia lookup connections, say), but I really suspect you’re going the very long way around to do something that will be simple once the task is made clear.

(Unfortunately, your explanation of the problem is so bogged down with decisions and attempts you’ve already made — decisions which strike me as odd — that it’s hard for me to get to the bottom of what you’re trying to do.)

Though I’m confused about why you have such convoluted tiddler names, I have a demo of what I think you’re looking for.

The trick — if you want to build a complex dynamic reference whose value will be used in a transclusion — is to use filter language to build the actual value string result you need (which you can see how I do in the demo).

Even though /Purchase/{{A!!Value}}/Content/Note looks ok when wikified, any attempt to pass that value along (in that form) to other widgets/macros will pass the string “as is” (with the curly braces and all), not in the interpreted form that you need.

Again, I suspect that your design structure is adding unnecessary complications, but at least I think my demo can help you see how transclusion to a complex computed tiddler name can be accomplished, if you approach it with filter syntax (addprefix and addsuffix around a variable which holds the indirect part).

Here’s a screenshot of my explanation from within Tiddler_B (which you can tinker with by following this link):

2 Likes

Hi @Springer ,

Thank you for this - and I will look at it in a little bit - and yeah - I am still new to this - but am a avid consumer of TiddlyWiki - for the last 8 or so months - and I’ve just scratched at the surface.

I’ll try and explain things better as time goes on - and I learn the correct verbiage.

You are spot on - with what I am trying to accomplish - sorry that it’s convoluted - as this is the only real way I know to explain myself.

I’ll give this a go and get back - but I understood about 60% of your answer - - - you did understand my question.

Let me put some work into this and give it a shot.

Thanks Again,

TwN00b

Thanks @Springer - This worked!

I’m stilling trying to understand it - ,…

<$let purchase-note= {{{ [{Tiddler_A!!Value}addsuffix[/Content/Note]addprefix[/Purchase/]] }}}>

<$transclude tiddler=<<purchase-note>>/>

</$let>

I don’t really edit TiddlyWiki much - and the {{{ outside - plus the [{ are ,… mystifying - as spaces, new lines, and squishing up code - all produce different results,… - man-o-man.

I do read the doc’s - but most of it just goes over my head - but I know that the answers are there - I just need more time with TiddlyWiki (apart from being a consumer of it).

I really do appreciate the help and patience you’ve shown.

(I just remembered that I can use ticks `` when posting - :slight_smile: )

Thanks Again!

TwN00b - - I’m Amazed at what can be done by the “Common Joe”,…

I tried to break down the basics of brackets in Those Pesky Brackets, it might help you make some sense of them

4 Likes

Wow - Thanks @Brian_Radspinner and @Springer,

This is invaluable information!

  • I copied both of your example pages - into my local Tiddler (html file)
    • In my: “help/tiddlywiki/examples/” and just created tiddlers in there
    • I love how I can create the illusion of a directory structure in TiddlyWiki ← this is by far the “best” feature - allows everything to be organized
    • I create a Table of Contents for each “directory” and I (soon) will be able to create a Tiddler that lists the contents inside - nice!
  • node.js: I don’t have node.js in my html - unsure what that is @Springer - ??
    • The only node.js I know of - runs on actual dedicated servers - at some location
    • So - I am not familiar with the TiddlyWikiNode.js file or how to use it - but I am fine with just the HTML file
    • To be honest - I’ve not looked into TiddlyWikiNodeJS (or whatever it’s called) - as the plain old TiddlyWiki.html file is perfect for me :grinning_face_with_smiling_eyes:

Back to Braces,…

I can now use the following: (My mind is enlightened,… - I get most of this - this is good - it’s a lot - but overall - awesome - and this helped me with Springer’s page - so I am good - and now see why my question was confusing,…)

What really helps is the side-by-side comparisons and examples that I can copy/paste into an empty tiddler - period.

  • This is by far the “BEST” way for any new person to learn - well, for us consumers and not dev guys :slight_smile:

  • Multiple ways to do the same thing - - Boom! Nice!

  • Simple instructions - explained - wow!

  • Copy and paste to an empty tiddler - to play with in real-time ← Woa! Boom!

    • I can’t stress how hard is it to go to TiddlyWiki.com and not be able to copy/paste the item - so us new folks head over to Google, Reddit, etc,…
    • As I learn - I would be happy to create examples - but I don’t understand the verbiage - yet
    • Like “filter run” - I can’t quite understand what it means - not yet - - something about: left to right - top to bottom - pipes and train stations,… - errr - wha,…?
  • [[]] and [] ← by themselves - and I understand what they mean! Thanks to you guys!

    • [title[Hello There]] which is the way to reference a tiddler with the title field that equals Hello There ← I get this now
    • [tag[Hello There]] to get a list of tiddlers that have been tagged with “Hello There” ← oh tag is a keyword as well - would you look at that - tag’s can be useful! (No way - yup - it’s true)
    • [prefix[Hello There]] to get a list of tiddlers whose titles starts with “Hello There.”
  • My understanding from this is items in between the [XXXX[ (the X’s - are keywords - aha!)

  • {{}} and {{!!xyz}} <— These make sense!

I’m still unsure on <$transclude $tiddler=<<title>> /> ,…

  • " A variable can be created via a macro , function , or procedure ; along with the list , set , vars , let , and wikify widgets."
  • I tied the let - per the items from Springer – but it does not work??
  • <$let purchase-note= {{{ [{Tiddler_A!!Value}addsuffix[/Content/Note]addprefix[/Purchase/]] }}}>
  • I then tried: <$transclude $tiddler=<<purchase-note>> />
    • Comes up with a blank page - - I thought it would show the “Create,… syntax”

I have a request,…

Can we add these and Springers excellent examples - “somewhere” new folks can find them? (Maybe on the main tiddlywiki search site?)

(I hate to admit that I can rarely find any answers on the side search-bar on tiddlywiki.com :frowning: )


Working through the basics,…

I am working through Brian’s basics - and what is a “filter run”? (I assume it executes some code - it runs the code.)

  • I was able to search for filter run on the tiddlywiki side:

I saw the Filter Run Tiddler:

Which is something called a railroad. (I think trains and box-cars.)

The verbiage is sparse - but googling shows that I can chain outputs to inputs - like a UNIX pipe - - I had no idea TiddlyWiki could do this - this is awesome,…!

  • I think that the <$list filter=" <— is this - unsure - but I think so - and you are “pipe-ing” it to Wikify via ,...}]"><$wikify name ="stuff"
  • Note: <$wikify name ="stuff" ← this has a space name =" after name - odd - but ok

This is great - and I will keep plugging away at it!

I realize now that I should use tags and “why” they are important - - I just never found a use for them - until now - - makes searching easier - Woa, mind blown - boom!

The reason I never had a need - is that I store my Tiddlers in a ‘directory’-like format:

  • /Dir/Dir/Dir/File,…

I guess you can say - I used my brain as the tag,…

Thanks Again - This let’s me know I need to remap a ton of personal Tiddlers,… (This will take a lot of time,…)

TwN00b – Amazed at how useful TiddlyWiki is becoming,…

What you name “keywords” is named: filter operator

{{}} … Is a shortcut for <$transclurd $tiddler=<<currentTidder>> /> Which will create an endless loop and a Recursion Error.

{{!!xyz}} … Is a shorcut for <$transclurd $tiddler=<<currenTidder>> $field="xyz" />

In this example the variable <<title>> needs to be define with eg: <$let title="HelloThere"> or something similar.

1 Like

Filter Run is any valid set of one or more //filter operators// between a set of [[ and ]].

[[HelloThere]] is a short filter run:

  • [[HelloThere]]

  • {{{ [[HelloThere]] }}}

  • <$list filter="[[HelloThere]]" />

…which is also a shortcut for the filter run [title[HelloThere]] which includes a single “title” filter operator to get a list of tiddlers have the title “HelloThere”.


[tag[Filter Operators]prefix[json]] is a filter run using both the “tag” and “prefix” filter operators to get a list of tiddlers tagged “Filter Operators” and the titles start with “json”.

<$list filter="[tag[Filter Operators]prefix[json]]">

</$list>

"[tag[Journal]!prefix[$:/]!sort[title]each[title]splitbefore[-]removesuffix[-]]" is a filter run using six filter operators.

<$list filter="[tag[Journal]!prefix[$:/]!sort[title]each[title]splitbefore[-]removesuffix[-]]" variable="year">

Journals for the year <<year>>

...
</$list>

Filter Expression is one or more valid “filter runs”:

[all[tiddlers]tag<label>!prefix[$:/]!has[draft.of]] :filter[get[tags]match<label>] is a filter expression with two filter runs:

  • [all[tiddlers]tag<label>!prefix[$:/]!has[draft.of]]
  • :filter[get[tags]match<label>]
\function find.ungrouped-items() [all[tiddlers]tag<label>!prefix[$:/]!has[draft.of]] :filter[get[tags]match<label>]
1 Like

And also:

Both are invalid syntax. As a rule of thumb: never use spaces around an “=” in attributes definition.

Valid syntax for these examples is:

<$let purchase-note={{{ [{Tiddler_A!!Value}addsuffix[/Content/Note]addprefix[/Purchase/]] }}}>

(removed the space after the “=” sign)

and

<$wikify name="stuff"

(removed the space before the “=” sign, but example is still incomplete)

Fred

1 Like

Well, the details of what node.js is don’t matter, then. I’m just not sure why your titles are such long concatenated path-like strings, and I thought maybe you did not have a single-html version of tiddlywiki (which is the usual version), and that you were somehow tracking tiddlers that live within a folder hierarchy. (I have no idea whether that would even make sense for node.js, but it was the only explanation I could imagine for that naming habit.)

The usual solution, in TiddlyWiki, would be to put your notes for The Cat in the Hat into the same tiddler as its other info, within a notes field. Alternately (if you have multiple such notes, for example multiple excerpts that each have their own metadata such as page number and commentary), you would put each of those notes into tiddlers with whatever title you like (such as a brief phrase summarizing the note), but then each note gets connected to The Cat in the Hat because there’s a field called source or book (or something), or it carries a The Cat in the Hat tag.

You seem to have designed this slash-separated compound name to separate different bits of info that (in my TiddlyWiki intuition) are really facets of the same thing. If there’s a problem that you’re trying to solve with this structure, I’m curious what it is!

It’s true that the TiddlyWiki core uses a kind of slash-separated logical space for its shadow tiddlers. But those core shadow tiddlers are really not designed for routine convenient access, and the complex namespace helps to keep them compressed and streamlined (without lots of separate fields). This kind of streamlining/compression is not worth it, in my opinion, for the actual content you work with, day in and day out.

Thanks for the note - @Springer,… I do really appreciate the help.

And yeah - I was not really using the tag feature of TiddyWiki - as I did not really understand tags - - until today. (Still kind of magical - but less so,…)

Mainly - I thought tag was just a word that was a quasi “category” thing-a-ma-bob - - that I could not really make work. (Mainly because I was not aware of them,…)


How Could I not be aware?

Well, It did not help me that I found the Projectify Plugin before I found TiddlyWiki - - via a google web search - and used it - - but I downloaded a copy from someone (I don’t remember who - a few years back - that had configured that TiddlyWiki HTML - to not show tags).

So in Projectify - none of my Tiddlers show the “tags”,… see image:

(This is my Day-To-Day PIM - that I use - - I replaced my Franklin Covey Paper Planner with this.)

Here is a view of a Tiddler:

Hence - I never really had the need to use them.


Also, I kept customizing my tiddlywiki html file - to what you see today - and I can not tell you how I got there - just that it’s fast, and I keep everything in “Folders”,… (I’ll soon change that to Tags).


Note: I do use tags - like when I copy/paste from you guys - and google and reddit.

  • Or when I create a task or item in Projectify
  • Or - some other use - ,… (limited to a need that requires them)

But - it’s limited - since - I did not really get them.


That said -

Most of my Tiddlers don’t have tags - with the exception of those that required them

  • I just have one large TiddlyWiki html file - about 200MB-ish - that I use day-to-day (pictured above)
    • I start it up via a terminal - full screen in Chrome
    • It’s still fast - as long as I don’t keep to many tiddlers open - which is why I switched to the “Table” view - - it’s the fastest for me
  • I have other ones that I am working on “pushing” data into them - that will be about 1 GB - give or take
    • Mainly my notes (never changing - just as a reference and lot’s of PDF’s - White Papers, Tech Notes, Manuals, etc.)
  • I do have Test Tiddlers, Wisdom Tiddlers, Brain Games, etc.
    • For example - my “Gifts for the kids” TiddlyWiki html - that includes many things - ranging from knowledge to actual physical items to ,…
    • You helped me with my Book List - that I am now using that same logic for other items in there
  • I do have other Tiddlers - as well - small ones - that I test with - like my KJV one,…
    • I am using what I am learning to create a Personal Bible Study App (to replace TheWord 6 – Windows app)
    • I am posting my updates here: https://kjv.tiddlyhost.com/
    • It’s fast - easy - and I am using the stuff I learn here - on there - - The last few days

Also, to be fair - I did try using tags - for the KJV App - per the various sites (another post) - but they were slooooow - - so I opted to put the bible and strongs and notes, etc (non-changing stuff) in a dictionary and just “search” them that way — the dictionary needed a tag to use - odd,…

So - to summarize - I use TiddlyWiki - in a “file-system”-like manner - - but will now consider tags - as they look amazing.

Thanks Again!

TwN00b - TiddlyWiki - A kept secret ,…

There are a lot of items I need to do - and I know TiddlyWiki can “do” them - I just need to take my time and attempt to “do” them.

Here is an example:

  • In the KJV Tiddly HTML File - - I want to be able to “change” a field - using a button - - in another Tiddler
  • Thanks to the advise you provided - I can do that,… - Nice!
    • BUT,… I am now trying to see how to do this from the value in a dictionary,… (yeah - it would be sweet)

Tiddler: UpdateVerse <— This is a button that will set another Tiddlers Field to a particular verse
Text:

<$button>
<$action-setfield $tiddler="/Bible/Structure/Selected_Bible_Verse" $field="Bible/Verses/Current" $value=<<Verse>>/>
"◀️ or ▶️"
</$button>

* This does not work  as I don't know how to set the <<Verse>> from the calling Tiddler,... - yet

Tiddler Dictionary (the one that I want to put a button in)
Text:

101_Gen_01_1:[[◀️|{{UpdateVerse}}]] - Gen 1:1 In the beginning God created the heaven and the earth. ⛓️ 🗯️ 🪧 🫧 💭 🔍 ↘️Job 38:4; Psa 33:6; Psa 89:11; Psa 136:5; Act 14:15; Act 17:24; Heb 11:3 | ↗️Psa 90:4; Pro 8:22; Joh 1:1-2; Joh 1:18; Joh 3:16; 2Co 12:2; 
102_Exo_01_1:[[👁️‍🗨️|102_Exo_01_1:]] - Exo 1:1 Now these are the names of the children of Israel, which came into Egypt; every man and his household came with Jacob. ⛓️ 🗯️ 🪧 🫧 💭 🔍 ↘️ | ↗️ ◀️ ▶️ 👁️‍🗨️

In a nutshel, when I “click” on the “UpdateVerse” Button - I want to set the field in the destination tiddler to :

  • The “Previous” Verse ← I am researching this
    The “Next” Verse ← Same here,…

Just one of many things that have me enjoy (and get frustrated at times) using TiddlyWiki,…

:slight_smile:

TwN00b

What prevents you from being able to copy/paste items from tiddlywiki.com?

This is in reference to being able to take text straight from TiddlyWiki - (copy it) and then paste it into my tiddler to try out.

In a nutshell, I can “copy” from Brian’s Page and “paste” it into my tiddly - to try it out.


For example - I am looking up: (trying different iterations)

  • How to use set command example
  • using set command instructions
  • set command ← This one gives me something - well - not really

image


So - I click on the link - and - well - nothing usable: (I can’t copy/paste from TiddlyWiki to my tiddler :slightly_frowning_face: )


So I go to Google, Reddit,… - - and if I spend more than about 4 hours - I ask here.


I guess I technically “could” copy and paste - but I should state - it’s not ,… helpful? Unsure - - either way - ,…

Hope this helps explain the comment.

TwN00b

The setfield command (and all the other “commands”) are for use as command-line options under node.js. See https://tiddlywiki.com/#Commands and https://tiddlywiki.com/#Using%20TiddlyWiki%20on%20Node.js for more info.

What you want is to look at the set widget documentation (see https://tiddlywiki.com/#SetWidget), which includes quite a few examples, all of which have a “copy to clipboard” button to the upper right of the example.

Please note that, while there are admittedly some deficiencies and gaps in the self-hosted TiddlyWiki documentation, and it does take a little bit of practice to get good at searching for what you really want to know, we (the entire TiddlyWiki community) are actively trying to improve the situation by suggesting rewrites and contributing new write-ups.

Unfortunately, for most users, working with TiddlyWiki is a “guilty pleasure” side-project that they have to squeeze into an otherwise busy “real life” whenever they can find the time, so progress on improving the documentation is an intermittent patchwork process at best.

Perhaps as you get further along in your exploration and discovery of the wonders of TiddlyWiki, you will be in a position to begin contributing some tangible materials to this documentation effort. In the mean time, please keep asking questions and making suggestions as to specific help topics that you feel could use some improvement, and we will try to respond here with “off the cuff” answers and guidance as best we can.

-e

4 Likes

Thanks @EricShulman - I appreciate this.

I am willing - to help - - - especially as a “consumer” verses “developer” - - - just need to understand where I can help.

Thanks Again,

TwN00b

^ This bit, yes. So well said!

It would not matter what technology you use, TiddlyWiki, HTML website, Wix these kinds of sizes are tending towards unusable for most internet users, and impossible for those with low bandwidth. If you wish to present such content it must be broken down into smaller pieces and load them on demand. TiddlyWiki can help with external tiddlers, node JS server implementations of TiddlyWiki can help.

  • A lot of information can be stored even in 10MB so perhaps you are including un optimised media.

Hi @TW_Tones - Yeah - I tend to agree - that for most Internet-based app’s that users will use - - most will be unusable for them - if the application is large. (There are some exceptions - of course - but the logic is spot on - IMHO.)

For me - I am not “hosting” (I think this is what Node.js is for) but not looked at it - in all honesty - as I just use plain old html files - and just using my files locally - in DropBox.

  • I did learn to “backup” them to gitlab - - - that’s pretty cool

As for presenting - I’ve not gotten there - yet - still learning the verbiage and ropes - as I am still just an advocate and consumer :smile: - with colleagues and friends viewing my PIM - and asking what it is.

  • I tend to give them the Dog & Pony Show - and encourage them to take a look

As for the sizes - I am not to concerned - as when my system slows down (it happens on my 8GB Mac Air M1) - I simply save my TiddlyWiki.html file - close that tab and re-open,… - done.

Also, it’s usually Zoom, Slack, Teams or one of my VM’s (Crossover, Parallels, Whiskey, VMWare, Wine, Ubuntu, Qemu, UTM, or,… I recently removed MacOS Emulators,…) that are the cause. I simply save my work, restart the “high ram usage” application and restart it.

:innocent: