Is there a way to set a CMS List Menu id prefix the same way there is for class?

James Jarrett asked on May 12, 2016 15:10

Is there a way to set the CMS List Menu id prefix the same way there is to set a prefix for the class?

I have multiple CMS List Menus in my template which have the same id which is getting flagged as an accessibility conformance issue.

<ul id="menuElem" class="PrimaryCMSListMenuUL">
    <li class="PrimaryCMSListMenuHighlightedLI">
    <a class="PrimaryCMSListMenuLinkHighlighted" href="/undergraduate/admissions.aspx">Admissions</a>
    </li>
    <li class="PrimaryCMSListMenuLI">
    <a class="PrimaryCMSListMenuLink" href="/undergraduate/visit.aspx">Visit Us</a>
    </li>
</ul>

<ul id="menuElem" class="SecondaryCMSListMenuUL">
    <li class="SecondaryCMSListMenuLI">
        <a class="SecondaryCMSListMenuLink" href="/undergraduate/admissions/apply.aspx">Apply</a>
    </li>
    <li class="SecondaryCMSListMenuLI">
        <a class="SecondaryCMSListMenuLink" href="/undergraduate/admissions/apply.aspx">Accepted Students</a>
    </li>
</ul>

Correct Answer

Trevor Fayas answered on May 12, 2016 15:21

It would be the "Item ID prefix" value. Setting that changes the menu ul's ID.

Otherwise keep in mind that the CSS List menu is really just a pre-configured Repeater, i often don't utilize the CSS List Menu webpart anymore because it has a lot of extra markup, and if you have a pre-defined web template you are implementing into Kentico it's best to make it match exactly.

2 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on May 12, 2016 15:21

It is hard coded based on the controls name in the code behind so, no, unless you modify the base code, there isn't a way to change it.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on May 12, 2016 17:14

Nice Trevor! When did that property get added? I've probably overlooked that a million times.

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on May 12, 2016 19:54

Brenden, it's been there at least since v8 (could be in v7 as well). The Corporate sample site uses it for the top nav :)

0 votesVote for this answer Mark as a Correct answer

James Jarrett answered on May 12, 2016 21:06

Thanks Trevor. That is exactly what I needed. One more accessibility issue marked off the list.

1 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on May 13, 2016 14:06

I agree to Trveor, I don't use it much because of the granular control it is unable to provide.

The kind of structure yu have above can be well achieved using a hierarchical viewer web part.

There is an article on build what you are achieving through CSS list menu by Hierarchical Viewer

http://devnet.kentico.com/articles/best-practices-for-implementing-site-navigation-in-kentico

Cheers, Chetan

0 votesVote for this answer Mark as a Correct answer

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