[TW5] very strange. TOC disappear from static .html.....

61 views
Skip to first unread message

Siniy-Kit

unread,
Oct 14, 2015, 10:46:51 AM10/14/15
to TiddlyWiki

Hi! I make a static template http://novye-podarki.ru/heeg.html#%24%3A%2Fcore%2Ftemplates%2Fstatic.tiddler.html an see In it's code my toc




<div class="tw-table-of-contents-top"><ol class="tc-toc toc-expandable">< li class="toc-item-selected">< a class="tc-tiddlylink tc-tiddlylink-resolves" href="%25D0%259A%25D0%25BE%25D0%25BD%25D1%2582%25D0%25B0%25D0%25BA%25D1%2582%25D1%258B.html">< span class=" tc-reveal">< button class="tc-btn-invisible">< svg class="tc-image-right-arrow tc-image-button" height="22pt" viewBox="0 0 128 128" width="22pt">    <path d="M80.3563798,109.353315 C78.9238993,110.786918 76.9450203,111.675144 74.7592239,111.675144 L-4.40893546,111.675144 C-8.77412698,111.675144 -12.3248558,108.130732 -12.3248558,103.758478 C-12.3248558,99.3951199 -8.78077754,95.8418109 -4.40893546,95.8418109 L66.8418109,95.8418109 L66.8418109,24.5910645 C66.8418109,20.225873 70.3862233,16.6751442 74.7584775,16.6751442 C79.1218352,16.6751442 82.6751442,20.2192225 82.6751442,24.5910645 L82.6751442,103.759224 C82.6751442,105.941695 81.7891419,107.920575 80.3566508,109.353886 Z" transform="translate(35.175144, 64.175144) rotate(-45.000000) translate(-35.175144, -64.175144) "></path>< /svg>< /button>< /span>< span class=" tc-reveal" hidden="true"></span> Контакты </a>< span class=" tc-reveal" hidden="true"></span>< /li>< li class="toc-item-selected">< a class="tc-tiddlylink tc-tiddlylink-resolves" href="%25D0%259E%2520%25D0%25BA%25D0%25BE%25D0%25BC%25D0%25BF%25D0%25B0%25D0%25BD%25D0%25B8/............................

but when I render my site to static ( tiddlywiki --verbose  --load heeg.html --rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html static text/plain)  I saw an empty TOC   in html code 

<div class='tw-table-of-contents-top'></div>


I think it is very strange, because I render  TOC from tiddler very good, but not from header. I have no idea where to look for mistake.....

Jeremy Ruston

unread,
Oct 14, 2015, 11:12:10 AM10/14/15
to tiddl...@googlegroups.com
Hi Siniy-Kit
I think it is very strange, because I render  TOC from tiddler very good, but not from header. I have no idea where to look for mistake…..

The issue is that global macros such as the TOC macro are only available in your template within the importvariables widget that imports them.

So the fix is to move your importvariables widget up to contain all the body content of the page.

Best wishes

Jeremy


--
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 http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/00169f12-f331-46aa-b1bc-d9da6365c78c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Siniy-Kit

unread,
Oct 14, 2015, 11:48:03 AM10/14/15
to TiddlyWiki
I don't know where to move  up <$importvariables> in what tiddler I can do it? I find it in $:/core/ui/PageTemplate , but there is no body there...

среда, 14 октября 2015 г., 18:12:10 UTC+3 пользователь Jeremy Ruston написал:

Jeremy Ruston

unread,
Oct 14, 2015, 12:11:15 PM10/14/15
to TiddlyWiki
Hi Siniy-Kit

You've got a customised "" tiddler. I'd suggest moving your customisations to a new tiddler like "$:/_my-static-template".

Here are the changes you need:

\define tv-wikilink-template() $uri_doubleencoded$.html
\define tv-config-toolbar-icons() no
\define tv-config-toolbar-text() no
\define tv-config-toolbar-class() tc-btn-invisible
`<!doctype html>


<html>
<head>
<link rel="prerender" href="heeg.html" />
<meta name="viewport" content="width=device-width">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />


<link id="faviconLink" rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="static.css">
<title>`
{{!!title}} {{!!nazvanie}}`</title>
<meta name="description" content="`
{{!!description}}`"/>
</head>
<body class="tc-body" style="width: 92%;">
`<$importvariables filter="[all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]">`
<span class="tc-topbar tc-topbar-left">
`<$view tiddler="$:/_header" field="text" format="htmlwikified"  />`
</span>
<section class="tc-story-river">
`<$view tiddler="$:/
core/ui/ViewTemplate" format="htmlwikified"/>`
</section>
`</$importvariables>`
<script async src="
heeg.js" type="text/javascript"></script>
</body>
</html>
`

Let me know how you get on,

Best wishes

Jeremy.

Siniy-Kit

unread,
Oct 14, 2015, 12:33:57 PM10/14/15
to TiddlyWiki
Thank you, Jeremy! it works good.

среда, 14 октября 2015 г., 19:11:15 UTC+3 пользователь Jeremy Ruston написал:
Reply all
Reply to author
Forward
0 new messages