Skip to content

Instantly share code, notes, and snippets.

@remitbri
Last active November 23, 2021 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save remitbri/5531487 to your computer and use it in GitHub Desktop.
Save remitbri/5531487 to your computer and use it in GitHub Desktop.
The aim is to list all the essays for all the categories an essay belongs to, in the context of essay.lens in a koken.me project. As of Koken v0.7.1, the solution https://gist.github.com/bradleyboy/0b4c335141bb2d22634f crashes the page. So, instead, manually, the solution below (rinse and repeat for all the categories of your project)…
<koken:categories>
<koken:loop>
<koken:if data="category.id" equals="1">
Also in <strong>{{ category.title }}</strong>
<ul>
<koken:load source="essays" filter:category="1">
<koken:loop>
<li>
<koken:link>
{{ essay.title }}
</koken:link>
</li>
</koken:loop>
</koken:load>
</ul>
</koken:if>
<koken:if data="category.id" equals="2">
Also in <strong>{{ category.title }}</strong>
<ul>
<koken:load source="essays" filter:category="2">
<koken:loop>
<li>
<koken:link>
{{ essay.title }}
</koken:link>
</li>
</koken:loop>
</koken:load>
</ul>
</koken:if>
[etc etc etc]
</koken:loop>
</koken:categories>
@remitbri
Copy link
Author

remitbri commented Aug 5, 2013

Problem fixed with v0.8.0 if I remember well, it's v0.9.2 at the time of writing of this comment, so I'm not deleting this for not breaking links to this, really.

@dawnbailey1974
Copy link

I am doing a statistics project for https://www.the-essays.com/statistics-project
and I'm glad I've found your code. Even thought it's old but still helpful and relevant

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