Hi,
I'm trying to add a html id attribute (to use as link anchor) in a "tabs" group but is not rendered. In the other hand, I can see "extra classes" added.

Comments

calbasi created an issue. See original summary.

campbellt_’s picture

Status: Active » Closed (outdated)

Closing due to outdated. Please reopen if still an issue.

marieAscomedia’s picture

Version: 8.x-1.0-rc6 » 8.x-3.1
Status: Closed (outdated) » Active

Hi,
I got the same problem. I think that the script which make the tabs works remove the id.
To get my id, i overwrite the theme file horizontal-tabs.html.twig like this :

{#
/**
 * @file
 * Default theme implementation for horizontal tabs.
 *
 * Available variables
 * - attributes: A list of HTML attributes for the wrapper element.
 * - children: The rendered children.
 *
 * @see template_preprocess_horizontal_tabs()
 *
 * @ingroup themeable
 */
#}
{% if element['#id'] is defined %} <div id="{{ element['#id'] }}"> {% endif %}
<div data-horizontal-tabs-panes{{ attributes }}>{{ children }}</div>
{% if element['#id'] is defined %} </div> {% endif %}