Support Center

Recent questions

About Koken

This Help Center provides support for Koken, a free content management system designed for photographers, artists and designers.

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

koken:covers on custom lens template

Theo

Oct 29, 2014 05:04PM EDT

Hi guys

I am building a custom theme. In the index.lens I want to load the first two cover images for each featured album, but my attempts have been without succes.

My markup looks like this (like it's supposed to?):

koken:load source="featured_albums"
koken:covers limit="2"
koken:loop
koken:img /
/koken:loop
/koken:covers
/koken:load

I use this (without the source) on the album.lens template and it works fine, yet on index.lens nothing happens.

Am I missing something?

Thanks!
Theo

Up 0 rated Down

Todd Dominey Koken Agent

Nov 03, 2014 05:22PM EST

Theo – should work. You can actually see an example of where do this in storage/themes/elementary/index.lens for reference.

Maybe this is obvious, but do you have featured albums assigned in the Library?

Up 0 rated Down

Theo

Nov 04, 2014 03:30AM EST
Hi Todd, thank you for your reply!

I have five featured albums with each at least two cover images. Loading the featured albums the default way works fine, but as soon as I add the koken:covers tag, nothing. I tried a few options, but I don't understand.

Here's what I have now and what works fine:

koken:load source="featured_albums"
koken:loop
div class="item"
koken:link title="View {{ album.title }}"
koken:img /
/koken:link
/div
/koken:loop
/koken:load

As soon as I add the covers tag no images are loaded. Here's the URL, if so you get an idea: http://stijndevos.com/indexx/
Up 0 rated Down

Todd Dominey Koken Agent

Nov 04, 2014 09:48AM EST

Theo – actually, I see what the issue with your original code is now. You were missing the koken:loop immediately after koken:load, which is needed to loop over each featured album. Inside that loop you’d output the covers data, like this:

koken:load source=“featured_albums”
koken:loop
koken:covers
koken:first (if you only want one, otherwise insert koken:loop)
koken:img
/koken:first
/koken:covers
/koken:loop
/koken:load

Up 0 rated Down

Theo

Nov 04, 2014 10:26AM EST
Okay, now I understand. I overlooked the first koken:loop is required, of course. Thank you very much Todd! You offer a great product and support.

This question has received the maximum number of answers.

support@koken.me
http://assets2.desk.com/
false
koken
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete