I am working on a site which publishes several very long documents. It provides a one section per page view and a all sections on one page view. Ditto, Wayfinder and TOC Generator have made this a delight to do. Thanks to all who contributed them.
I also provide a floating div in the left margin which drops down a copy of the table of contents on mouse over to simplify navigation. That was also made simple with Wayfinder and TOC Generator.
However, I’d like to use a TV to determine where the startID is so I can use the same template for each long document and merely change the TV. The problem I have is that the template uses a chunk and the TV resides in the chunk. Even though the TV ultimately resides in the template, it does not appear to be parsed because it is in a chunk. How can I make that work?
I know it sounds a bit convoluted so here are the details. Instead of using [*content*] in my template, I use a TV named [*Specialization*] which specifies a chunk:
<div id="content" class="right">{{[*Specialization*]}}</div>
This allows me to make minor changes and still use the same basic template for almost all my documents - very simple maintenance and consistency.
I then have chunks such as None (simply contains [*content*]), Blog, Download, LongDocChunks, LongDocOnePage. These names are specified in the TV. Thus the template becomes something like:
<div id="content" class="right">{{LongDocChunks}}</div>
{{LongDocChunks}} contains:
<div class="topleftfixed"><a href="[~44~]#TopAnchor">Display Table of Contents</a><div class="tablecontents">[[Wayfinder? &startId=`44` &textOfLinks=`pagetitle` &sortBy=`longtitle`]]</div></div>[*content*]
This works perfectly fine as long as my document chunks parent is #44. I would like to use this same specialization for many different documents by using a TV, e.g.,
<div class="topleftfixed"><a href="[~[*tocdoc*]~]#TopAnchor">Display Table of Contents</a><div class="tablecontents">[[Wayfinder? &startId=`[*tocdoc*]` &textOfLinks=`pagetitle` &sortBy=`longtitle`]]</div></div>[*content*]
I created a TV named tocdoc and tried both number and string types. When I enter 44 (or any of the other parent IDs), it fails, i.e., there is no Wayfinder output.
I am assuming that, because the chunk is not a template even though it resides in the template, the TV is not being translated. Is there a way to make this work? Is there another way to accomplish the same goal? I am trying to use only HTML and CSS to make the site as accessible as possible (besides my complete ignorance of javascript and php). Thanks - John
Hello, all. I’ve been away from this project for a while and have not solved it on my own. Does anyone have a solution for using a TV inside a chunk inside a template as described below? Thanks - John