Koken – Add topics

Topics associate essays with albums (and vice versa). They allow you to write about a public album in your Library, then publish the album’s title, cover, or other data in the essay. You may also link the topic to the album’s content page so essay readers can see more. This also works in reverse so that albums may display links to essays that have been written about them.

In this tutorial we’ll show how topics are assigned, an example of how they may appear when published, plus the necessary template tags theme designers would use to publish them.

Assigning topics

While editing an essay, the (right) Inspector panel will display a row labeled “Topics” towards the top. Essays by default are not assigned any topic. Click the “edit” link as shown below.

A sheet will appear displaying all your public albums (see below). Click “Add” next to the album(s) you’d like to assign as the essay’s topic, then click “Done”.

Another way to assign a topic is when inserting an album slideshow into an essay. The “Add slideshow” sheet will display a checkbox at bottom left (see below). Checking it while inserting media will add the album as a topic as part of the process.

Displaying topics

How topics are displayed on your site depends on the theme you are using. Below is a screenshot of an essay with the album “Bikes” assigned as its topic in the default Chastain theme.

Template markup for topics

If you’re designing your own theme you would use the Lens template tag in the essay.lens template, the album.lens template, or as part of a custom template that loads album or essay data (see koken:load documentation for more info) to output information about the topic.

In the code example below we loop over each album that’s been assigned as a topic, display the album’s title and primary cover image using the tag. Both the album title and image are wrapped with to load the album’s site page when clicked.

        <koken:img preset="small" />
        {{ album.title }}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.