1.0.0-beta.4 • Published 5 years ago

@impactdk/ngx-cms-formbuilder v1.0.0-beta.4

Weekly downloads
2
License
-
Repository
-
Last release
5 years ago

ngx-cms-formbuilder

This library is used to standardize form data sent from and to a CMS.

Supported CMS

CMSSupport
Umbraco FormsYes
Sitecore FormsComing

Usage

  1. Import the module into your AppModule and configure it to point towards your CMS
imports: [
    CmsFormbuilderModule.forRoot(
        'https://url-to-umbraco/rest/v1/forms', // URL to CMS API
        'umbraco' // Type of CMS
    )
];
  1. Import the service to fetch the form
export class AppComponent implements OnInit {
    formData?: CmsForm;

    constructor(private formService: CmsFormService, private cd: ChangeDetectorRef) {}

    ngOnInit() {
        this.formService.getFormById('GUID').subscribe(data => {
            this.formData = data;
            this.cd.markForCheck();
        });
    }
}
  1. Lastly use the imported component to display the form (or roll your own using the form data)
<div *ngIf="formData"><cms-form-page [formData]="formData" [pageId]="currentPageId"></cms-form-page></div>

Notes for Umbraco

Currently we support almost all fields in Umbraco Forms and most workflows.

FieldSupport
Short answerYes
Long answerYes
DateYes (make sure your template checks for null)
CheckboxYes
File uploadNo
PasswordYes
Multiple choiceYes
Data ConsentYes
DropdownYes
Single choiceYes
Title and descriptionYes
HiddenYes
RecaptchaNo
Recaptcha2No