But I will want to transclude those tiddlers in other tiddlers, let’s call them parents, with <$transclude field="text" mode="inline-block"/>
The problem is that when viewing the parent tiddler, the chapter.article and pagenumber parts of the macro no longer show the data from the child tiddler but from the parent tiddler.
What do I need to change so that I am seeing the chapter.article and pagenumber of the child even when viewing from the parent?
That is, what do I put instead of <<currentTiddler>> in the macro? I have tried numerous things: {{!!title}}, <<storyTiddler>>
I also tried deleting the macro from the child and then transcluding the child with a template of <$transclude field="text" mode="inline-block"/> <span class="thingray"><$view field="chapter.article"/>, <$view field="pagenumber"/></span>
The problem is that inline-block doesn’t appear correctly in the parent, and if I change it to block, the chapter and page number bits go onto the next line after the text. In most cases I will want them on the same line as the text.
As you can see I gave it a good try before bothering you all. Any help I can get is appreciated!
The transclude widget transcludes whatever “currentTiddler” happens to be, and the “tiddler” parameter is the template tiddler to use to display whatever “currentTiddler” happens to be.
So your transclude widget in your parent tiddler is showing the parent tiddler but using “New Tiddler” as the template.
I switch the forum editor to fullscreen mode when I do write a reply and play with code to make sure it actually works as described. It sometimes happens that the chat is going on and I don’t see it. …
Since the work is already done, I do post it. May be others find it useful in the future.
-m
This place is definitly the place to be to progress and learn our favorite tool.
I found your solution useful for one of my wiki. But there is to much space between links in the list generated like a blank line under each list element.
Hi Thomas,
There is a little issue with TW HTML code generation. The creation of P elements is a bit excessive. You can modify the list a bit as follows. We add a DIV element with a class=“small-v-gap” for smaller vertical gap to the parent tiddler
Add a new tiddler eg: myStyles and tag it: $:/tags/Stylesheet .. You can adjust the margin-top and -bottom separately as needed. Or you can set it to margin: 0; which would change the class name to .no-v-gap
.small-v-gap p {
margin-top: .1rem;
margin-bottom: .1rem;
}