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

adding classes to elements

Dave Willis

Sep 24, 2014 08:50PM EDT

I'm developing a custom theme and I'd like to add classes to the markup generated by tags like <koken:navigation />. How can I do that?
Thanks!

Up 0 rated Down

Todd Dominey Koken Agent

Sep 25, 2014 09:57PM EDT

Dave – some tags (like koken:link, etc) that generate an html tag directly allow you to add class=“whatever” to the tag. That class assignment is then passed-through to the tag that’s created. In the case of koken:navigation however, that tag is a little different because it outputs a bunch of markup. What I’d recommend doing is something like this:

https://gist.github.com/tdominey/46b84f977fe90218d10c

Up 0 rated Down

Dave Willis

Sep 25, 2014 11:26PM EDT
Hi Todd!
Thanks for the response! Targeting the element is easy enough but I'm using Twitter Bootstrap and was hoping to leverage it's classes on the navigation. I suppose I could add them with JavaScript but there would likely be a flash of unstyled elements. Styling it myself would probably be better than that. Is there any other way to get a list of links? An API perhaps?
Thanks!
Up 0 rated Down

Todd Dominey Koken Agent

Sep 26, 2014 03:29PM EDT

Dave – yeah, unfortunately there isn’t a way to get at that navigation link data through any other means. It’s an interesting idea though and something we should probably consider expanding in the future, but for today that’s how it is. If you do assign classes or whatever dynamically you could set the initial display property of the nav to “none” to hide it, then when your code has done its thing set display to block. If you’re doing jquery targeting it with .hide() and .show() would do that.

Anyway, just an idea for the interim.

Up 0 rated Down

Dave Willis

Sep 26, 2014 05:51PM EDT
Okay, thanks. I'm discovering that I can't add links to specific tags to the navigation anyway so I think I'll just write my own markup and hard code the navigation. I don't intend to distribute this theme.

You might look at MODX's templating engine and the Wayfinder snippet that generates navigation. It handles this kind of thing beautifully. It's not quite as dead simple as Koken is (I started learning to use the Lens templates and two hours later had my site 75% done! I was literally LOLing at how easy you've made it!) but it's also crawling a tree structure and generating sometimes complex, multi-level lists, which I assume Koken doesn't need to do. Every last bit of markup is completely templatable though. I'm a front-end developer so I don't really know what's involved in recreating that kind of functionality though. It may not be feasible for you. Regardless, I'm loving Koken for my photography site. You guys have really solid product. Managing my site straight from LR is fabulous. :)
Thanks!
Up 0 rated Down

Todd Dominey Koken Agent

Sep 30, 2014 12:55PM EDT

Thanks Dave – appreciate it. :) Let us know if you have any feedback on the Lens tags/variables/templates. Always looking to improve.

This question has received the maximum number of answers.

support@koken.me
http://assets0.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