Use the below code to create tab
echo JHtml::_('bootstrap.startTabSet', 'tab', ['active' => 'tab1']);
echo JHtml::_('bootstrap.addTab', 'tab', 'tab1', 'Tab 1 Title');
echo 'Tab 1 Content';
echo JHtml::_('bootstrap.endTab');
echo JHtml::_('bootstrap.addTab', 'tab', 'tab2', 'Tab 2 Title');
echo 'Tab 2 Content';
echo JHtml::_('bootstrap.endTab');
echo JHtml::_('bootstrap.endTabSet');
Tabs displayed
Tabs are not being displayed
Joomla 4 nightly build
Maybe we need to wait for PR #31990 merged to have it works ?
Labels |
Added:
?
|
Title |
|
Title |
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-01-23 10:40:09 |
Closed_By | ⇒ | wilsonge |
Status | Closed | ⇒ | New |
Closed_Date | 2021-01-23 10:40:09 | ⇒ | |
Closed_By | wilsonge | ⇒ |
@joomdonation I think the selector needs to be a CSS selector and you're passing a string (which will result to an element tag tab
which obviously doesn't exist)
The example code should make it clear what's broken here: https://github.com/dgrammatiko/bs5/blob/cbd103ddb7e28632d563bdec0a3af6fee4a813f9/test_component/site/tmpl/tab/default.php#L19-L33
@dgrammatiko The selector actually becomes part of id of the Tabset. We have been using it for years, see the code from staging https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/views/article/tmpl/edit.php#L65
(and just for information, that code has been working at least until recently)
@joomdonation but does it work if you pass it as a class? The B/C break is something new after the Bootstrap V5 and it might be reverted or patched in a way that will be B/C (undecided at this point).
@dgrammatiko Yes. If I pass a class selector, then it works
echo JHtml::_('bootstrap.startTabSet', '.tab', ['active' => 'tab1']);
echo JHtml::_('bootstrap.addTab', '.tab', 'tab1', 'Tab 1 Title');
echo 'Tab 1 Content';
echo JHtml::_('bootstrap.endTab');
echo JHtml::_('bootstrap.addTab', '.tab', 'tab2', 'Tab 2 Title');
echo 'Tab 2 Content';
echo JHtml::_('bootstrap.endTab');
echo JHtml::_('bootstrap.endTabSet');
But this is B/C break and should be fixed.
@joomdonation please test #32146
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-01-24 15:17:01 |
Closed_By | ⇒ | joomdonation |
Thanks @dgrammatiko . I can confirm that it fixed the reported issue.
@joomdonation please mark your test as successfully at https://issues.joomla.org/tracker/joomla-cms/32146
@wilsonge I tried again with nightly build today and the issue is still not fixed yet.