helsingborg-stad / modularity-frontend-form
Frontend Form for Modularity.
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 2
Type:wordpress-plugin
pkg:composer/helsingborg-stad/modularity-frontend-form
Requires
- helsingborg-stad/acfservice: ^1.0.1
- helsingborg-stad/wpservice: ^2.0
Requires (Dev)
- brain/monkey: ^2.6
- codedungeon/phpunit-result-printer: ^0.31.0
- php-stubs/wordpress-stubs: ^6.8
- phpunit/phpunit: ^9.5
- dev-main
- 0.59.1
- 0.59.0
- 0.58.7
- 0.58.5
- 0.58.2
- 0.58.1
- 0.58.0
- 0.57.7
- 0.57.4
- 0.57.2
- 0.57.1
- 0.57.0
- 0.56.2
- 0.56.1
- 0.56.0
- 0.55.15
- 0.55.14
- 0.55.12
- 0.55.11
- 0.55.10
- 0.55.5
- 0.54.4
- 0.54.2
- 0.54.0
- 0.53.48
- 0.53.44
- 0.53.42
- 0.53.41
- 0.53.40
- 0.53.39
- 0.53.38
- 0.53.37
- 0.53.36
- 0.53.35
- 0.53.34
- 0.53.33
- 0.53.31
- 0.53.30
- 0.53.28
- 0.53.26
- 0.53.24
- 0.53.22
- 0.53.21
- 0.53.20
- 0.53.19
- 0.53.18
- 0.53.17
- 0.53.16
- 0.53.15
- 0.53.14
- 0.53.13
- 0.53.12
- 0.53.11
- 0.53.10
- 0.53.8
- 0.53.7
- 0.53.6
- 0.53.5
- 0.53.0
- 0.52.29
- 0.52.27
- 0.52.25
- 0.52.19
- 0.52.13
- 0.52.11
- 0.52.9
- 0.52.4
- 0.52.0
- 0.51.7
- 0.51.6
- 0.51.5
- 0.51.4
- 0.51.2
- 0.51.1
- dev-fix/link-to-a-page-that-contains-module
- dev-feat/go-to-first-invalid-step-when-trying-to-submit-faulty
- dev-refactor/return-clears-overlay
- dev-chore/lint
- dev-feat/options-taxonomies-postttype
- dev-refactor/working-and-loading
- dev-fix/deselect-ol-ul-if-the-other-is-selected
- dev-fix/wysiwyg-faulty-lists
- dev-feat/legal-fields
- dev-feat/link-to-frontend-editor
- dev-refactor/wysiwyg-button-coloring
- dev-fix/hide-progressbar-when-steps-count-less-than-2
- dev-fix/namespace-nested-fields
- dev-refactor/validation-messages-for-fields
- dev-refactor/lang-to-basicmapper
- dev-refactor/adding-cq-to-layout-grid
- dev-refactor/layout-grid-and-span-for-repeaters
- dev-feat/create-grid-classlist
- dev-test/hover-progress
- dev-refactor/progressbar-and-animations
- dev-refactor/nicer-step-loader
- dev-refactor/step-animation-and-step-layout
- dev-fix/scroll-to-left-after-reverse-place-search
- dev-fix/no-validation-on-disabled-fields
- dev-fix/invalidate-map-size-after-rendering
- dev-fix/correcting-for-modularity-merge-with-municipio
- dev-fix/repeater-conditionals-not-working-correctly
- dev-fix/correcting-classlist-for-wysiwyg
- dev-fix/correcting-gallery-filesmax-and-maxsize
- dev-refactor/allow-id-on-fields
- dev-fix/correcting-button-label-for-repeaters
- dev-feat/wysiwyg
- dev-fix/classList-support
- dev-refactor/always-return-an-array-error-field
- dev-fix/select-dropdown-falls-under-footer
- dev-fix/amount-of-rows-repeater-not-working-with-0
- dev-fix/only-show-error-icon-when-error
- dev-fix/true-false-field-not-working
- dev-refactor/taxonomy-field-with-multiple-views
- dev-feat/adding-title-field-group
- dev-fix/correcting-step-title
- dev-feat/adding-support-for-acf-gallery-field
- dev-refactor/webpack-to-vite
- dev-refactor/init-refactor
- dev-feat/interfaceform
- dev-feat/adding-lang-to-mappers
- dev-feat/ability-to-choose-handler
- dev-test/validation-thursday-may-15-tdd
- dev-feat/data-processing
- dev-fix/corrected-notice-icon-array-keys
- dev-feat/js-validation
- dev-feat/fieldmapping-director
- dev-test/something
- dev-feat/submit
This package is auto-updated.
Last update: 2025-12-01 12:13:54 UTC
README
A modular, accessible, and extensible multi-step frontend form system for WordPress, built with TypeScript, PHP, and SCSS. Supports custom field types, validation, REST API integration, and advanced admin configuration.
Features
- Multi-step forms: Create forms with any number of steps, each with its own fields, validation, and UI.
- Custom field types: Supports text, email, date, checkbox, select, WYSIWYG, repeater, and more.
- Progress bar: Visual step progress indicator with validation feedback.
- REST API integration: Submit, update, and read form data via secure endpoints.
- Admin configuration: Use ACF to configure steps, fields, handlers, and logic.
- Validation: Client and server-side validation, including custom error messages.
- Accessibility: ARIA attributes, keyboard navigation, and semantic HTML.
- Status overlays: User feedback for loading, errors, and success.
- Security: Nonces, token validation, and output escaping.
- Extensible: Add custom field types, handlers, and hooks.
Usage
1. Add a Form Module
- In WordPress admin, add a new "Frontend Form" module.
- Configure steps and fields using the ACF field group "Configure Multistep Form".
- Each step can have a title, description, and any number of fields.
- Supported field types: text, email, date, checkbox, select, WYSIWYG, repeater, etc.
2. Configure Submission Handlers
- Choose where submissions are sent: Database, E-Mail, Webhook.
- Configure handler settings in the module admin (e.g., webhook URL, email recipient).
3. Display the Form
- Use the module in any Modularity-enabled area (template, block, shortcode).
- The form will render with animated step transitions, progress bar, and validation.
4. REST API Endpoints
- Submit:
POST /wp-json/modularity-frontend-form/v1/submit/post - Update:
POST /wp-json/modularity-frontend-form/v1/submit/update - Read:
GET /wp-json/modularity-frontend-form/v1/read/get - Nonce:
GET /wp-json/modularity-frontend-form/v1/nonce/get - All endpoints require valid nonces and tokens for security.
5. Customization
- Add new field types by extending the JS/TS field architecture.
- Add new handlers by implementing PHP handler interfaces.
- Use SCSS variables for theming in
sass/_variables.scss. - Override translations in the admin or via language files.
Example: Basic Usage
-
Add a module:
- Go to "Add Module" → "Frontend Form".
- Configure steps and fields.
-
Display in template:
- Use Modularity's template system or shortcode to render the form.
-
Handle submissions:
- Data is stored, emailed, or sent to a webhook as configured.
Developer Guide
- JS/TS: All frontend logic is in
/source/js/. Use TypeScript interfaces for all APIs. - PHP: Backend logic, REST API, and admin config in
/source/php/. - SCSS: Styles in
/source/sass/. Use variables for theming. - Tests: Unit tests are next to source files. Run with
npm test(JS/TS) orcomposer test(PHP). - Linting: Use
npm run lintfor JS/TS.
Accessibility & UX
- All UI components are ARIA-compliant and keyboard accessible.
- Animations are smooth and non-blocking.
- Progress bar and step navigation are visually clear.
Security
- All output is escaped in PHP templates.
- All user input is validated and sanitized.
- Nonces and tokens are required for all REST API requests.
Extending the Plugin
- Add a field type: Create a new JS/TS class in
/source/js/fields/field/. - Add a handler: Implement a PHP handler in
/source/php/DataProcessor/Handlers/. - Add a REST endpoint: Extend
/source/php/Api/.
Contribution Guidelines
- Fork, branch, and submit pull requests for all changes.
- Write clear commit messages.
- Review code for style, security, and performance.
- Follow the standards in
.github/copilot-instructions.md.
License
MIT
For more details, see .github/copilot-instructions.md and the source code. All code, documentation, and contributions must follow workspace guidelines.