1

I want to add custom fields to my component. My admin edit view uses bootstrap tabs:

<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', array('active' => 'general')); ?>

<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'general', Text::_('COM_MYCOMP_TITLE', true)); ?>

Then I render the fieldset:

<?php echo $this->form->renderFieldset('general'); ?>

Now I want to render my custom fields before the endTabSet using:

<?php $this->ignore_fieldsets = array('general'); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>

But this gives me an error of Notice: Undefined index: Joomla\CMS\HTML\Helpers\Bootstrap::startTabSet.

Any advice greatly appreciated.

1 Answer 1

0

If it is your own component you don't really need to use custom fields. In your form xml file you can define a field set, as for general, and then in your edit template add a new tab, render the field set and then close the tab. In fact with a lot of field sets you can just cycle through them. Is that what you meant?

1
  • Thanks for your suggestion but perhaps I didn't make this question clear enough. Yes it is my component but I want to provide the "admin user" of the component to be able to "add" their own custom fields. So currently I have the custom fields able to be added to the component and then when a new record is added, then custom field is displayed BUT I get this error about the undefined index. If you have a look at the standard User Management system, the administrator of the site can add extra fields to the user record through Custom Fields (com_fields) so user adds data to these fields. Dec 5, 2021 at 5:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.