Treesaver / treesaver

JavaScript library for creating column and page-based layouts
GNU General Public License v2.0
1.06k stars 112 forks source link

Update Chrome with breadcrumbs #306

Closed styks1987 closed 11 years ago

styks1987 commented 11 years ago

So after much trial and many errors, I finally discovered that inorder to have {{something}} replaced it had to be within the gird and use the data-ts-template="document" to get the current pages meta data set in the TOC. What I would like to do is accomplish this in the chrome section of the resources file. I can see all the pages by looping through {{#contents}} but I cannot figure out how to load a meta data associated with a single current page into the chrome area.

<div class="chrome">
        <div class="breadcrumb" data-ts-template="document">
          <a href="/">furple</a>
          <a href="">{{current-page-title}}</a>
        </div>
</div>
{"contents":[
    {"url":"/bfbbffb.html","current-page-title":"firstpage"}, 
    {"url":"/ababab.html","current-page-title":"secondpage"}
]}

thanks!

andreacampi commented 11 years ago

You should ask this kind of questions on the mailing list.

It's actually data-ts-template="currentdocument" and yes, the documentation is in a sad state in this regard.

This example would be a good starting point: https://github.com/Treesaver/treesaver/tree/master/examples/template-currentdocument

styks1987 commented 11 years ago

Thank you! That is exactly what I was looking for.