{"id":22963048,"url":"https://github.com/terminal42/contao-mp_forms","last_synced_at":"2025-04-05T21:09:12.187Z","repository":{"id":4404540,"uuid":"5541846","full_name":"terminal42/contao-mp_forms","owner":"terminal42","description":"Real step separation in the form generator of the Contao Open Source CMS","archived":false,"fork":false,"pushed_at":"2025-01-27T07:29:36.000Z","size":231,"stargazers_count":25,"open_issues_count":6,"forks_count":14,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-29T20:07:40.197Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terminal42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"terminal42","ko_fi":"terminal42"}},"created_at":"2012-08-24T15:03:43.000Z","updated_at":"2025-02-11T16:52:07.000Z","dependencies_parsed_at":"2024-05-07T13:28:15.131Z","dependency_job_id":"42f9f5e6-2580-4849-a90d-b065c6043530","html_url":"https://github.com/terminal42/contao-mp_forms","commit_stats":{"total_commits":135,"total_committers":11,"mean_commits":"12.272727272727273","dds":"0.19999999999999996","last_synced_commit":"0c72e327a468620b10df0b42ea4bbce88e7071ed"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terminal42%2Fcontao-mp_forms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terminal42%2Fcontao-mp_forms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terminal42%2Fcontao-mp_forms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terminal42%2Fcontao-mp_forms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terminal42","download_url":"https://codeload.github.com/terminal42/contao-mp_forms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399878,"owners_count":20932880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-14T19:20:03.555Z","updated_at":"2025-04-05T21:09:12.169Z","avatar_url":"https://github.com/terminal42.png","language":"PHP","funding_links":["https://github.com/sponsors/terminal42","https://ko-fi.com/terminal42"],"categories":[],"sub_categories":[],"readme":"# mp_forms\n\nThis is a Contao extension that allows you to create real forms over multiple pages.\n\nAfter installing the module, you have a new setting in the form definitions where you can define the GET parameter\nyou want the extension to work with. By default, this is `step` so it will generate `step=1`, `step=2` etc. in the URL.\nIf, for whatever reason `step` is already in use on your webpage, you can change the settings there.\n\nMoreover, you'll get a new form field called `Page break`. Every time you use this form field, the module will insert a\npage break in the form.\n\n`mp_forms` validates if a user manually wants to go to step 3 and did not fill in step 1 or 2. I this case the user will be redirected\nto step 1 (obviously, only if you had required fields on step 1).\n\nIn case you don't want your users to be redirected but prefer to have some Ajax magic, you may combine this extension\nwith our [ajaxform](https://github.com/terminal42/contao-ajaxform) one. They work perfectly well together!\n\n:warning: **You may not use the regular submit form field element**:\n\u003e Note that you must not be using a regular submit form field but use the `Page break` again. Otherwise, you\n\u003e won't have any `back` button displayed. `mp_forms` will automatically detect the last `Page break` as behaving like the form submit.\n\u003e If you use the regular submit form field anywhere in your form, `mp_forms` is completely disabled and you won't have\n\u003e any steps!\n\n## The `Summary` element\n\nA typical use case of forms that are split into multiple steps is to summarize data that was previously entered.\nThis might be on the final step before the data is submitted but it can also happen in between.\nYou can use this special form field type to display the data.\nAccessing the data can be done via the \"Simple Token\" technology that is typical for Contao.\nAll the form fields of previous steps are passed on using the `##form_*##` notation.\nYou may also access the labels using `##formlabel_*##`.\n\nFiles are handled a bit differently because there is more than just one value to a file.\nYou may use `extension`, `size`, `mime` as well as a `download_url` which is generated for you.\nTo make things simple, the default token for the file (e.g. if the form field was named `upload` that would be `##file_upload##`)\ncontains the HTML rendered using the `ce_download` template.\n\nA simple summary for all the submitted fields, encapsulated in simple `\u003cdiv\u003e` elements can be displayed using\nthe `##mp_forms_summary##` token.\n\nBecause trying things out yourself is usually easier and so you don't have to remember all the tokens that can be\nused, you may simply place the `##mp_forms_debug##` token  which will show you all the available tokens with their\ncontent.\n\n## Frontend module to display a step navigation\n\nThis module ships with a front end module that allows you to easily build a front end navigation for\neach of your steps.\nNot styled at all, it might look something like this in the end:\n\n![Example for step navigation](docs/navigation_example.png)\n\nNote that by default steps will just be named `Step x` in every language. The `Page break` form field\nlabel field will be used for the navigation if you provide it.\n    \n## Insert tags\n\nThere are insert tags you can use to fetch information about the state of the form:\n\n| Insert tag                                           | Description                                      | Example  |\n|------------------------------------------------------|--------------------------------------------------|----------|\n| `{{mp_forms::\u003cform id\u003e::step::current}}`             | Contains the current step you are on             | 2        |\n| `{{mp_forms::\u003cform id\u003e::step::total}}`               | Contains the total steps of your form            | 5        |\n| `{{mp_forms::\u003cform id\u003e::step::percentage}}`          | Contains the percentage of your progress         | 20       |\n| `{{mp_forms::\u003cform id\u003e::step::numbers}}`             | Contains a classic `x of y` display              | `2 / 5`  |\n| `{{mp_forms::\u003cform id\u003e::step::label}}`               | Contains the label of the current step           | `Step 1` |\n| `{{mp_forms::\u003cform id\u003e::field_value::\u003cfield_name\u003e}}` | Contains the submitted value of a previous field |          |\n\nNote that they can be especially useful together with a `Custom HTML` front end module.\nLet's assume you want to display a progress bar for form ID `5`:\n\n````html\n\u003cdiv class=\"progress\"\u003e\n    \u003cdiv class=\"progress-bar\"\u003e\n        \u003cdiv class=\"progress-bar-inner\" style=\"width:{{mp_forms::5::step::percentage}}%\"\u003e\u003c/div\u003e\n    \u003c/div\u003e\n    \u003cdiv class=\"numbers\"\u003e{{mp_forms::5::step::numbers}}\u003c/div\u003e\n\u003c/div\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterminal42%2Fcontao-mp_forms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterminal42%2Fcontao-mp_forms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterminal42%2Fcontao-mp_forms/lists"}