Content navigation links can provide their own IDs

Currently IDs are forced on skins. To aid the transition of
CologneBlue to Mustache it should be possible for skins to set
an ID key to override this behaviour in custom menus.

Change-Id: I3f3d5caf380425b463d840e487749dc06433f763
This commit is contained in:
jdlrobson 2020-12-11 12:43:00 -08:00 committed by Jdlrobson
parent 1a94be9c2a
commit cf2785e606

View file

@ -1131,6 +1131,10 @@ class SkinTemplate extends Skin {
// Setup xml ids and tooltip info
foreach ( $content_navigation as $section => &$links ) {
foreach ( $links as $key => &$link ) {
// Allow links to set their own id for backwards compatibility reasons.
if ( isset( $link['id'] ) ) {
continue;
}
$xmlID = $key;
if ( isset( $link['context'] ) && $link['context'] == 'subject' ) {
$xmlID = 'ca-nstab-' . $xmlID;