Current item or current class for dynamic content

Hi there,

is there a way to add either a .current class, aria-current or similar to a button in a cornerstone (Pro) looper query, that links to the currently active page? Let’s say we have a category archive layout page with buttons in a terms looper query, where 1 button has another style indicating the current term.

Regards
Roman

Hello Roman,

Thanks for writing in! The category archive page will these body classes:

Take notice of the category-uncategorized which translates to category-slug in any of the category archive pages. You can use this class along with your custom class in your button using the term slug. This would be your example custom CSS to indicate the current term button:

.category-uncategorized .uncategorized {
    /* your styling here */
}

where .category-uncategorized is the archive page body class and .uncategorized is the term slug you used in your Button element as a class.

Hope this makes sense.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.