ID and Class order in Tab shortcode
-
In the generated html of the Tab shortcode by the plugin_shortcode.php in the tabs-folder the ID “oscitas-tabs-*” is set in the >ul<.
$scontent = '<ul class="nav nav-tabs'.EBS_CONTAINER_CLASS.'" id="oscitas-tabs-' . $id . '">' . implode('', $_oscitas_tabs[$id]['tabs']) . '</ul><div class="tab-content'.EBS_CONTAINER_CLASS.'">' . implode('', $_oscitas_tabs[$id]['panes']) . '</div>';
This is different to the Accordion/Toggle shortcode, where the ID is set to the surounding div.
$output .= '<div class="panel-group ' . $class .EBS_CONTAINER_CLASS. '" id="oscitas-accordion-' . $id . '">' . $scontent;
This makes much more sense, e.g. if the class (yourcustomclass ) which can set in the shortcode has a background attribute it’s not possible to make the Tab container without this background.
Therefore it would be better to change the code for the tab shortcode to
$scontent = '<ul class="nav nav-tabs'.EBS_CONTAINER_CLASS.'">' . implode('', $_oscitas_tabs[$id]['tabs']) . '</ul><div class="tab-content'.EBS_CONTAINER_CLASS.'">' . implode('', $_oscitas_tabs[$id]['panes']) . '</div>'; if (trim($scontent) != "") { $output = '<div id="oscitas-tabs-' . $id . '" class="' . $class . '">' . $scontent; $output .= '</div>';
I didn’t check if this should be done for other shortcodes.
Thanks
Thomas
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘ID and Class order in Tab shortcode’ is closed to new replies.