\define mytoc(category)
<div class="tc-custom-toc">
<div class="tc-table-of-contents">
<<toc-selective-expandable tag:"""$category$""" sort:"""sort[title]""">>
</div>
</div>
\end<pre> .tc-custom-toc {
border-radius: 4px;
padding: 5px 10px;
border: 1px solid <<colour message-border>>;
<<box-shadow "2px 2px 10px rgba(0, 0, 0, 0.5)">>
} </pre>\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline
.tc-tagged-toc .tc-tiddler-body:after {
content: '<$macrocall $name="mytoc" category={{!!title}}/>';
}\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline
If so, the problem will be that the list of allowed rules doesn't include the rule that understands widget calls like you <$macrocall> widget.
The cleanest way around this would be to put your macrocall widget into a macro at the top of the stylesheet tiddler, and then invoke it in your :after declaration (the rules pragma above allows the macro invocation syntax).
Best wishes
Jeremy
I'm trying to insert a macro-call into several tiddlers through stylesheets, such that the macro is processed/called within the tiddler it has been parsed into.
Specifically, I'm trying to add a call to my custom TOC macro at the end of all tiddlers tagged with TOC.
However, it does not work. I can call my macro inside tiddlers with <$macrocall $name="mytoc" category={{!!title}}/> and it works fawlessly. But I'm unable to "inject" it with CSS.
What am I missing?
my code:
$:/macros/mytoc (tagged $:/tags/Macro )\define mytoc(category)
<div class="tc-custom-toc">
<div class="tc-table-of-contents">
<<toc-selective-expandable tag:"""$category$""" sort:"""sort[title]""">>
</div>
</div>
\end
$:/custom_styles (tagged $:/tags/Stylesheet and of type text/vnd.tiddlywiki)
(this simply applies a box shadow to my TOCs)<pre> .tc-custom-toc {
border-radius: 4px;
padding: 5px 10px;
border: 1px solid <<colour message-border>>;
<<box-shadow "2px 2px 10px rgba(0, 0, 0, 0.5)">>
} </pre>
$:/custom_styles2 (tagged $:/tags/Stylesheet and of type text/css)
(This should add the TOC macro call to all tiddlers tagged with "toc")
.tc-tagged-toc .tc-tiddler-body:after {
content: '<$macrocall $name="mytoc" category={{!!title}}/>';
}
--
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.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/ce605a91-21c3-49f8-8598-a4a5b6098304%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline
\define mytoc2(category)
<div class="tc-custom-toc">
<div class="tc-table-of-contents">
<<toc-selective-expandable tag:"""$category$""" sort:"""sort[title]""">>
</div>
</div>
\end
.tc-tagged-toc .tc-tiddler-body:after {
content: '<$macrocall $name="mytoc2" category={{!!title}}/>';
}
I'm trying to insert a macro-call into several tiddlers through stylesheets,
PS: How can I marked this thread as solved? It's the first time I post here