Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the Joomla registration form in Particle #3151

Closed
webarion opened this issue May 15, 2023 · 1 comment
Closed

Get the Joomla registration form in Particle #3151

webarion opened this issue May 15, 2023 · 1 comment

Comments

@webarion
Copy link

webarion commented May 15, 2023

Joomla receives the fields of the standard registration form in this way:

<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
  <?php if ($fieldset->name === 'captcha' && $this->captchaEnabled) : ?>
    <?php continue; ?>
  <?php endif; ?>
  <?php $fields = $this->form->getFieldset($fieldset->name); ?>
  <?php if (count($fields)) : ?>
    <fieldset>
      <?php if (isset($fieldset->label)) : ?>
        <legend><?php echo Text::_($fieldset->label); ?></legend>
      <?php endif; ?>
      <?php echo $this->form->renderFieldset($fieldset->name); ?>
    </fieldset>
  <?php endif; ?>
<?php endforeach; ?>

I am trying to get these fields in a particle:
{{ dump( joomla.call( 'FieldsHelper::getFields', 'com_users.registration' ) ) }}
This returns NULL. Tell me please, how can I do this?

@webarion
Copy link
Author

webarion commented May 24, 2023

I managed to create a solution to my question. Here's how to get the standard Joomla 4 registration form:

{% set form = joomla.call( 'JForm::getInstance', 'registration', constant('JPATH_ROOT')~'/components/com_users/forms/registration.xml' ) %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant