Assistance with an exploration of wrapping content

37 views
Skip to first unread message

TonyM

unread,
Jul 12, 2019, 10:37:50 PM7/12/19
to TiddlyWikiDev
Folks,

I am experimenting on an idea, that I can share in full, If I can find a method wrapping content. I intend to do this in the view template and elsewhere.

This is very easy to do unless that which you whish to wrap has opening and closing tags.

For example, say I choose to target the text field in the viewTemplate

<$set name=test-value value="Content of test-value">

Display the body of the tiddler as found in the text field where test-value=<<test-value>>

</$set>

For example modify $:/core/ui/ViewTemplate/body

<$reveal tag="div" class="tc-tiddler-body" type="nomatch" stateTitle=<<folded-state>> text="hide" retain="yes" animate="yes">


<$list filter="[all[current]!has[plugin-type]!field:hide-body[yes]]">


{{Prefix-content}} here


<$transclude>


<$transclude tiddler="$:/language/MissingTiddler/Hint"/>


</$transclude>


{{Suffix-content}} here


</$list>


</$reveal>

For reasons that may be obvious to others this does not work.

Can anyone suggest a way to permit this?

Regards
Tony

TonyM

unread,
Jul 12, 2019, 10:40:28 PM7/12/19
to TiddlyWikiDev
Post script

Others would include being able to use a html tag with a style within it. are their particular tags that do not break in this situation?

Eg: I know we can use the class field.
<section class="blah">
Body
</section>

Regards
Tony

Mat

unread,
Jul 13, 2019, 5:45:39 AM7/13/19
to TiddlyWikiDev
I don't understand your question, or at least not what the problem is. It does work to insert the prefix etc in the viewtemplate like that. Also the little <$set> block you define can be in place of the prefix or suffix transclusions. - ?

<:-)

Jeremy Ruston

unread,
Jul 13, 2019, 1:14:24 PM7/13/19
to tiddly...@googlegroups.com
Hi Tony

To wrap existing content with wikitext that incorporates opening and closing tags, then one would normally use a transclusion. So, to wrap a DIV around the content of a tiddler:

<div>
{{myTiddler}}
</div>

There’s no way to transclude the “<div>” and “</div>” separately from different tiddlers.

Can you outline what you’re trying to accomplish?

Best wishes

Jeremy

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/b6fda1e2-b196-44fd-b0c2-f3dc036e5f97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

TonyM

unread,
Jul 13, 2019, 1:46:52 PM7/13/19
to TiddlyWikiDev
Jeremy,

I wanted to see if I could define variables based on current tiddler and have them valid within the text, but not outside the tiddler.

I can now see how to do it through a template tiddler and a tip from Mario showed me how I can hide the text (like folding a tiddler without interaction) so we don't see the text twice.

I also wanted to display an alternative text field if a tiddlername/snapshot tiddler existed.

I belive there were other reasons including self contained tiddlers.

If it were possible to have a template field on a tiddler it would help.

All this can be done with conditional view template tricks but these need to operate on every tiddler, not a specific tiddler.

Thanks for asking.
Tony

Reply all
Reply to author
Forward
0 new messages