Heather
Heather

Reputation: 3

Sorting Kentico Repeater Items into Alphabet "Categories"

Is there a way I can put the items that come out of a Repeater into a JavaScript array so that I can sort them into an alphabetical category?

Is there a ways to do this with a transformation?

Upvotes: 0

Views: 188

Answers (2)

Jake Kula
Jake Kula

Reputation: 1

You might be able to do this using JQuery after the repeater has loaded its content. For example, if your repeater renders a list (un-ordered UL/LI for example) then you can iterate that list using a JQuery function and push the items into the array.

Here's an article which might help you along: Jquery push all li's ID's into array

Upvotes: 0

JanH
JanH

Reputation: 519

Yes, use ApplyTrnasformation method with the code name of the transformation you use in your repeater and apply it on the collection of pages within a macro in your javascript.

Example:

<script>
var o = '{%Documents.Where("NodeParentID=123").ApplyTransformation("cms.menuitem.javascript")%}';
</script>

Upvotes: 1

Related Questions