Skip to content

Instantly share code, notes, and snippets.

@jackydra
Last active December 21, 2015 17:38
Show Gist options
  • Save jackydra/6341559 to your computer and use it in GitHub Desktop.
Save jackydra/6341559 to your computer and use it in GitHub Desktop.
koken lens variables issue
<p>Work
<koken:load>
{{ _parent.album.context.position }}
/
{{ album.counts.total }} <!-- prints the number of albums in this set -->
</koken:load>
</p>
@jackydra
Copy link
Author

Hello,
I'm dealing again with lens variables and having some problems.

This time i'm in the page within a Set, where 10 albums are displayed. I wanted to get for each album its numerical position in the list of all the albums of the set, and display this information like 1/10 for the first album, 2/10 for the second, and so on....

So I took {{ album.context.total }} and {{ album.context.position }} and played a little while with them (i tried lot of things cuz i could not understand how to implement them from the documentation), but no result...
I'm making a custom theme, and this time i'm working on album_index_loop.html. How do the lens variables work?

@jackydra
Copy link
Author

i was able at least to make the {{ album.context.total }} work. Nonetheless {{ album.context.position }} does not print anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment