I’d like to add an observation, just for posterity.
I was trying to add a class <div>
wrapper inside of a transclusion that I was revealing using a <$reveal>
widget using a <$transclude>
widget. I know there’s a template attribute that can be applied to the transclude widget to achieve approximately the same as using the {{tiddler||template}} syntax.
This didn’t work:
transclusion
<$transclude tiddler="summary—Mission statement" mode="block" template="$:/templates/aiTransclusion" />
template (a tiddler named $:/templates/aiTransclusion)
<div class="ai">
<transclude />
</div>
This works:
translusion:
{{summary—Research abstract||$:/templates/aiTransclusion}}
template:
<div class="ai">
<$transclude mode="block" />
</div>
I tried a few other variants that didn’t work, such as this:
<$transclude tiddler="summary—Mission statement" mode="block" data-type="ai"/>
…in which case, the CSS would have been selecting for [data-type="ai"]
rather than div.ai
, and there wouldn’t have been any template.
basis of this observation
The reason I tried using <$transclude>
with a template attribute was because I previously solved a similar problem using a <$list>
widget and using its template attribute to format the list with a template tiddler.
For curiosity,
Is there some way I could have alternately use a syntaxt like <$list template=$:/templates/aiTransclusion>
for my current, straightforward transclusion that simply needs to get wrapped in a div (or alternately get an extra class or other CSS identifier in the HTML element rendered by the transclusion), all of which pops into view using a <$reveal>
widget?
Just asking for learning and public documentation purposes.