Blog Categories List with Aria Labels

Dave Nelson asked on May 17, 2018 14:23

To meet WCAG 2.0 AA guidelines the "Tag Cloud" that we have on our website needs to use the same URLs as "File Under" categories at the bottom of our blog.

Currently we use the Tag Cloud web part which outputs the link: <a href="/blog-posts/blog.aspx?tagname=budget&amp;groupid=24">budget</a>

While the code for the ASCX Tranformation used to display blog posts outputs the link: <a href="/blog-posts/blog.aspx?tagid=150">budget</a>

I need one of three things to happen for conformance

  1. The URLs need to match (my preference).
  2. The link text needs to be different, maybe change one to include "category" in the text
  3. Include Aria Labels to make one of them different, this would be the best for visitors with assistive technologies

How can I change our code to make one of these changes happen?

Recent Answers


David te Kloese answered on May 18, 2018 14:49

Hi,

I think the cleanest thing would be to create a custom macro to replace the tag display you have.

So now you have something like:

<%# BlogFunctions.GetDocumentTags(Eval("DocumentTagGroupID"), Eval("DocumentTags"), "/") %>

And update it to something like:

<%# GetBetterTags(Eval("DocumentTagGroupID"), Eval("DocumentTags"), "/") %>

In the api examples of the documentation you can find how to retrieve tag information: https://docs.kentico.com/api11/content-management/tags


For quick results you could go for a .Replace(...) as suggested by the 2nd comment from Brenden here: https://devnet.kentico.com/questions/blogfunctions-getdocumenttags()-not-working. But guess in you're case that might be getting a bit to complicated.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.