Fundraising/Internal-facing/CiviCRM/Exporting FormBuilder Pages into an extension

From Wikitech

Like the SearchKit Search export, this would also be helpful if the extension by which the FormBuilder page is built on was designed to be reusable. The following steps would describe how to ensure a FormBuilder page is packaged into a custom extension.

  1. Having completed the designing of the FormBuilder page.
  2. On the FormBuilder home page, locate the row that corresponds to your FormBuilder page and take note of the designated name in the name column.
  3. On the computer file system, navigate to this directory: drupal/sites/default/files/civicrm/ang. This directory is where the Afform templates are initially stored whenever the FormBuilder page is designed.
  4. To make this FormBuilder page available wherever the extension is installed, the files corresponding to the desired FormBuilder page would have to be moved to the extension directory.
  5. Search for files corresponding to the name of the FormBuilder page (from Step 2). Assuming the name of the FormBuilder page is afsearchTest, the required files to copy in the directory would be afsearchTest.aff.html and afsearchTest.aff.json.
  6. Copy these files.
  7. On the extension direction in the file system, create a new directory titled "ang".
  8. Paste this new files into the "ang" directory created in Step 7.
  9. Now the FormBuilder page would always be available wherever the extension is installed.
Related Topics: