├── LICENCE ├── examples ├── members.form-generate-recovery-code.xsl ├── members.form-regenerate-activation-code.xsl ├── members.form-login.xsl ├── members.form-activate-account.xsl ├── members.form-register.xsl ├── members.form-reset-password.xsl ├── members.form-edit-account.xsl ├── members.config.en.xsl └── members.config.de.xsl ├── members.forms.xsl └── README.md /LICENCE: -------------------------------------------------------------------------------- 1 | All source code included in the "Members Forms" archive is, unless otherwise 2 | specified, released under the MIT licence as follows: 3 | 4 | ----- begin license block ----- 5 | 6 | Copyright 2011 Michael Eichelsdoerfer 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | ----- end license block ----- -------------------------------------------------------------------------------- /examples/members.form-generate-recovery-code.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 | 32 |
33 | -------------------------------------------------------------------------------- /examples/members.form-regenerate-activation-code.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 | 32 |
33 | -------------------------------------------------------------------------------- /examples/members.form-login.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 |
35 | 36 |
37 | -------------------------------------------------------------------------------- /examples/members.form-activate-account.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
35 |
36 | 37 |
38 | -------------------------------------------------------------------------------- /examples/members.form-register.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
42 |
43 | 44 |
45 | -------------------------------------------------------------------------------- /examples/members.form-reset-password.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
42 |
43 | 44 |
45 | -------------------------------------------------------------------------------- /examples/members.form-edit-account.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 20 | 21 |
22 |
23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 |
47 |
48 | 49 |
50 | -------------------------------------------------------------------------------- /examples/members.config.en.xsl: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 15 | 16 | false 17 | 18 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 32 | 33 | 34 | 39 | 40 | 41 | 42 | 43 | 44 | The username is invalid. It must be at least 4 characters. 45 | 46 | 47 | 'Username' is a required field. 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 'Email' does not seem to be a valid address. 57 | 58 | 59 | 60 | 61 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | The password recovery code was invalid or has expired. 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 'Activation Code' is a required field. 103 | 104 | 105 | 106 | 107 | 108 | There is no password field in the active Members section. 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 |

Registration was successful.

118 |

Problems occurred during registration.

119 |
120 | 121 | 122 |

An email has been sent. If you do not receive it in the next couple of minutes, please inform the webmaster at webmaster@example.com.

123 |

There was a problem sending your registration email. Please inform the webmaster at webmaster@example.com.

124 |
125 |
126 | 127 | 128 | 129 |

Hello? You know that you must not do this!

130 |
131 |
132 |
133 | 134 | 135 |

Your account has been saved.

136 |

Problems occurred while saving your account.

137 |
138 | 139 | 140 | 141 |

Hello? You know that you must not do this!

142 |
143 |
144 |
145 | 146 | 147 |

Activation was successful.

148 |

Problems occurred while activating your account.

149 |
150 | 151 | 152 |

An email has been sent. If you do not receive it in the next couple of minutes, please inform the webmaster at webmaster@example.com.

153 |

There was a problem sending your activation email. Please inform the webmaster at webmaster@example.com.

154 |
155 |
156 |
157 | 158 | 159 |

A new activation code has been created.

160 |

Problems occurred while generating your activation code.

161 |
162 | 163 | 164 |

An email has been sent. If you do not receive it in the next couple of minutes, please inform the webmaster at webmaster@example.com.

165 |

There was a problem sending your activation email. Please inform the webmaster at webmaster@example.com.

166 |
167 |
168 |
169 | 170 | 171 |

You are logged in.

172 |

Problems occurred while trying to log you in.

173 |
174 |
175 | 176 | 177 |

A recovery code has been created which allows you to set a new password.

178 |

Problems occurred while creating your recovery code.

179 |
180 | 181 | 182 |

An email has been sent. If you do not receive it in the next couple of minutes, please inform the webmaster at webmaster@example.com.

183 |

There was a problem sending your recovery code email. Please inform the webmaster at webmaster@example.com.

184 |
185 |
186 |
187 | 188 | 189 |

Your new password has been saved successfully.

190 |

Problems occurred while saving your new password.

191 |
192 |
193 |
194 |
195 |
196 | 197 |
198 | -------------------------------------------------------------------------------- /members.forms.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
40 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
70 |
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 |
173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 |
194 |
195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 |
227 | 228 | 229 |
    230 | 231 |
232 |
233 |
234 |
235 |
236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 |
  • 254 | 255 |
  • 256 |
    257 |
    258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 |
    286 | 287 |
    288 |
    289 |
    290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 |

    298 | 299 |

    300 |
    301 |
    302 |
    303 | 304 |
    305 | -------------------------------------------------------------------------------- /examples/members.config.de.xsl: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 15 | 16 | false 17 | 18 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 32 | 33 | 34 | 39 | 40 | 41 | 42 | Benutzername ist ein Pflichtfeld. 43 | Benutzername ist ein Pflichtfeld. 44 | Der Benutzername ist ungültig. Er muss mindestens 4 Zeichen lang sein und darf nur aus Buchstaben, Zahlen und Minuszeichen (-) bestehen. 45 | Benutzername ist bereits vergeben. 46 | Benutzer nicht gefunden. 47 | Benutzername ist ein Pflichtfeld. 48 | 49 | Benutzername ist ein Pflichtfeld. 50 | Benutzername ist ein Pflichtfeld. 51 | Der Benutzername ist ungültig. Er muss mindestens 4 Zeichen lang sein und darf nur aus Buchstaben, Zahlen und Minuszeichen (-) bestehen. 52 | Benutzername ist bereits vergeben. 53 | Benutzer nicht gefunden. 54 | Benutzername ist ein Pflichtfeld. 55 | 56 | 57 | 58 | 59 | 60 | E-Mail ist ein Pflichtfeld. 61 | E-Mail ist ein Pflichtfeld. 62 | E-Mail-Adresse ist bereits vergeben. 63 | E-Mail ist ungültig. 64 | Benutzer nicht gefunden. 65 | 66 | E-Mail ist ein Pflichtfeld. 67 | E-Mail ist ein Pflichtfeld. 68 | E-Mail-Adresse ist bereits vergeben. 69 | E-Mail ist ungültig. 70 | Benutzer nicht gefunden. 71 | 72 | 73 | 74 | 79 | 80 | Passwort ist ein Pflichtfeld. 81 | Passwort ist ein Pflichtfeld. 82 | Passwort ist zu kurz. Es muss mindestens 6 Zeichen lang sein. 83 | Passwort ist nicht sicher genug. 84 | Passwort ungültig. 85 | Passwort-Bestätigung stimmt nicht. 86 | 87 | Passwort ist ein Pflichtfeld. 88 | Passwort ist ein Pflichtfeld. 89 | Passwort ist zu kurz. Es muss mindestens 6 Zeichen lang sein. 90 | Passwort ist nicht sicher genug. 91 | Passwort ungültig. 92 | Passwort-Bestätigung stimmt nicht. 93 | 94 | 95 | 96 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | Der Notfallcode ist ungültig oder abgelaufen. 118 | 119 | Der Notfallcode ist ungültig oder abgelaufen. 120 | 121 | 122 | 123 | 124 | 125 | Aktivierungscode ist ein Pflichtfeld. 126 | Aktivierungsfehler. Der Aktivierungscode ist ungültig oder abgelaufen. 127 | Der Benutzer ist bereits aktiviert. 128 | Der Benutzer ist nicht aktiviert. 129 | Aktivierungscode ist ein Pflichtfeld. 130 | 131 | Aktivierungscode ist ein Pflichtfeld. 132 | Aktivierungsfehler. Der Aktivierungscode ist ungültig oder abgelaufen. 133 | Der Benutzer ist bereits aktiviert. 134 | Der Benutzer ist nicht aktiviert. 135 | Aktivierungscode ist ein Pflichtfeld. 136 | 137 | 138 | 139 | 140 | 141 | Der aktive Mitgliederbereich hat kein Passwort-Feld. 142 | Ein Notfallcode kann nicht erzeugt werden wenn man angemeldet ist. Sie müssen sich vorher abmelden! 143 | 144 | Der aktive Mitgliederbereich hat kein Passwort-Feld. 145 | Ein Notfallcode kann nicht erzeugt werden wenn man angemeldet ist. Sie müssen sich vorher abmelden! 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 |

    Die Registrierung war erfolgreich.

    154 |

    Probleme sind aufgetreten.

    155 |
    156 | 157 | 158 |

    Ein E-Mail wurde verschickt. Sollte es in den nächsten Minuten nicht bei Ihnen ankommen, benachrichtigen Sie bitte den Webmaster unter webmaster@example.com.

    159 |

    Es gab ein Problem beim E-Mail-Versand. Bitte benachrichtigen Sie den Webmaster unter webmaster@example.com.

    160 |
    161 |
    162 | 163 | 164 | 165 |

    Hallo? Sie wissen doch wohl, dass Sie das nicht dürfen!

    166 |
    167 |
    168 |
    169 | 170 | 171 |

    Der Account wurde gespeichert.

    172 |

    Probleme sind aufgetreten.

    173 |
    174 | 175 | 176 | 177 |

    Hallo? Sie wissen doch wohl, dass Sie das nicht dürfen!

    178 |
    179 |
    180 |
    181 | 182 | 183 |

    Die Aktivierung war erfolgreich.

    184 |

    Probleme sind aufgetreten.

    185 |
    186 | 187 | 188 |

    Ein E-Mail wurde verschickt. Sollte es in den nächsten Minuten nicht bei Ihnen ankommen, benachrichtigen Sie bitte den Webmaster unter webmaster@example.com.

    189 |

    Es gab ein Problem beim E-Mail-Versand. Bitte benachrichtigen Sie den Webmaster unter webmaster@example.com.

    190 |
    191 |
    192 |
    193 | 194 | 195 |

    Ein neuer Aktivierungscode wurde erzeugt.

    196 |

    Probleme sind aufgetreten.

    197 |
    198 | 199 | 200 |

    Ein E-Mail wurde verschickt. Sollte es in den nächsten Minuten nicht bei Ihnen ankommen, benachrichtigen Sie bitte den Webmaster unter webmaster@example.com.

    201 |

    Es gab ein Problem beim E-Mail-Versand. Bitte benachrichtigen Sie den Webmaster unter webmaster@example.com.

    202 |
    203 |
    204 |
    205 | 206 | 207 |

    Sie sind angemeldet.

    208 |

    Probleme sind aufgetreten.

    209 |
    210 |
    211 | 212 | 213 |

    Ein Notfallcode wurde erzeugt, der es ermöglicht, ein neues Passwort zu vergeben.

    214 |

    Probleme sind aufgetreten.

    215 |
    216 | 217 | 218 |

    Ein E-Mail wurde verschickt. Sollte es in den nächsten Minuten nicht bei Ihnen ankommen, benachrichtigen Sie bitte den Webmaster unter webmaster@example.com.

    219 |

    Es gab ein Problem beim E-Mail-Versand. Bitte benachrichtigen Sie den Webmaster unter webmaster@example.com.

    220 |
    221 |
    222 |
    223 | 224 | 225 |

    Das neue Passwort wurde erfolgreich gespeichert.

    226 |

    Probleme sind aufgetreten.

    227 |
    228 |
    229 |
    230 |
    231 |
    232 | 233 |
    234 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Members Forms 2 | 3 | This collection of XSLT utilities will help you integrate the Members extension into your Symphony website. It can save many hours (probably days) of work. 4 | 5 | You should know how a members system basically works. If you have no idea, please take a look at the [Members README](https://github.com/symphonycms/members) and the [Members Wiki](https://github.com/symphonycms/members/wiki), especially the [Big Picture](https://github.com/symphonycms/members/wiki/The-Big-Picture). 6 | 7 | **What can Members Forms do for you?** 8 | 9 | - Auto-render your HTML form elements in a consistent way. 10 | - Auto-render "invalid" class attributes for form elements. 11 | - Auto-render validation summaries for events, featuring: 12 | - configurable event message validation summaries (e.g. "Your registration has been saved successfully."); 13 | - configurable field level error messages (e.g. "You are late. This username is already taken."); 14 | - Auto-render validation summaries for filter options, containing configurable messages (e.g. "An email has been sent to you. Read it!") 15 | - Auto-insert post-values into form inputs. 16 | 17 | Members Forms deals with the following challenges: 18 | 19 | - Many different event (error) messages make rendering form elements and messages on the frontend complicated. (Some generic error messages will even be output in `` nodes instead of field name nodes). 20 | - Members provides a "pseudo event" called `member-login-info`. 21 | - Special fields like `password`/`password-confirm`/`recovery-code` or the `identity` field need special solutions regarding field names and event XML messages alike. 22 | 23 | Included are seven `members.form-...` utilities which simply call named templates. The interesting stuff is the following files: 24 | 25 | - the configuration file; in the `examples` folder you find: 26 | 27 | - `members.config.de.xsl` (example German configuration file) 28 | - `members.config.en.xsl` (example English configuration file) 29 | 30 | - `members.forms.xsl` (form templates, validation logic etc.) 31 | 32 | 33 | ## Download 34 | 35 | Members Forms can be downloaded from Github: 36 | 37 | 38 | ## Release Notes 39 | 40 | [2.1] 41 | 42 | - Change formatting of examples (more XML-ish) 43 | 44 | [2.0] 45 | 46 | - [BREAKING] Change naming for classes (BEM style) 47 | 48 | [1.4] 49 | 50 | - Change formatting (more XML-ish) 51 | 52 | [1.3] 53 | 54 | - Fixes 55 | - Allow custom classes for submit inputs 56 | 57 | [1.2] 58 | 59 | - Added hidden input elements for Members section ID to example forms. (The Members extension works with multiple sections now.) 60 | 61 | [1.1] 62 | 63 | - Introduced the ability to set an ID for input elements of type "submit" by explicitely passing an ID to named templates (see "Usage" section of this README). 64 | - Introduced the ability to override auto-generated IDs for all other input fields by explicitely passing an ID to named templates (see "Usage" section of this README). 65 | 66 | 67 | ## Quick Start 68 | 69 | 1. Rename the download folder to `members-forms` and throw it into the `workspace/utilities` folder of your website. 70 | 2. Copy at least one language file and all the `members.form-...` files in the `examples` folder to the root of your `utilities` folder. This will prevent them from being overwritten if you update the `members-forms` folder. (If you move them anywhere else, you will have to change the include paths in these files.) 71 | 3. Now rename your config file to `members.config.xsl`. (If you choose a different name, you must change line 12 of `members.forms.xsl` to include the right file.) 72 | 4. If you have not done it already, set up the Members extension and a Members section. 73 | 5. Go through the configuration file and change all the field handles to reflect the field names (labels) in your Members section. 74 | 75 | Now you can build your first Members Forms page (a simple login page): 76 | 77 | 78 | 80 | 81 | 82 | 83 | 84 | 85 | 86 |

    Login

    87 | 88 | 89 |

    You are logged in. (Logout)

    90 |
    91 | 92 | 93 | 94 |
    95 |
    96 | 97 |
    98 | 99 | (Try it with missing or invalid values as well.) 100 | 101 | 102 | ## Configuration 103 | 104 | If you look at the example files (the English configuration file and the German version), you will see that you are free to customize only a little (EN) or really a lot (DE). 105 | 106 | **Please read those configuration files in order to understand what Members Forms is supposed to do.** 107 | 108 | All Symphony events will render event messages in XML using Symphony's system language. This is why you will need a configuration file which fits to your system language. (You may, however, include field level messages in several languages into a single configuration file, so nothing will happen when the system language will be switched. Please take a look at the provided German configuration file `members.config.de.xsl` to see how this works). 109 | 110 | Basically you will configure: 111 | 112 | - a datasource name (required to build an edit form for member data); 113 | - fields; 114 | - events and filter options. 115 | 116 | ### Field Validation 117 | 118 | In order to add an "invalid" class attribute to your form fields, the field configuration needs to know which errors to "listen" to. Your username field, for example, will have to include the following: 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | If any of the configured error messages occur, the field will be marked as invalid. 127 | 128 | Because of the variety of different errors I decided to never check for `missing` or `invalid` type attribute values. Instead Members Forms always compares the `message` attribute value! 129 | 130 | Localization/customization of error messages in validation summaries can be done by simply adding the desired string - it may even contain HTML: 131 | 132 | You should tell us your username. (What is a username?) 133 | 134 | Node names and error messages must reflect your field's label! So if the username field in your Members section is called "Name of the User", the field configuration must look like this: 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | Name of the User is a required field. 144 | 145 | 146 | 147 | ### Event Validation 148 | 149 | The configuration should be rather self-explanatory. You may configure custom event messages which will override Symphony's event messages. If an element is missing in the configuration, the Symphony message will be used. You may completely suppress an event message by adding an empty node to the configuration: 150 | 151 | 152 | 153 | ### Filter Option Validation 154 | 155 | Filter options follow the same basic logic as events. 156 | 157 | In addition it is possible to configure more than one filter for an event. Every __configured__ filter will get a validation summary __if it provides a message attribute__ (natively or here in the configuration file). So omitting validation for a filter option completely can be done by simply not adding the said filter to the configuration. 158 | 159 | 160 | ## Usage 161 | 162 | When configuration is done, import the template files in your pages and call the form templates from within your page template. Here are the code snippets (assumed that you have moved the example files to the root of your `utilities` folder): 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | ### Overriding Auto-generated IDs 186 | 187 | If you add **two or more forms** to the same page, ID clashes may occur due to input field IDs being auto-generated using the naming scheme `concat('fields-', $field-handle)`. 188 | 189 | To solve this, version 1.1 of Members Forms introduced the ability to **override auto-generated IDs** for input fields by explicitely passing an ID to named templates. For example, if you add a login form to any page, you may want to use the following in `members.form-login.xsl`: 190 | 191 | 192 | 193 | 194 | 195 | 196 | The above will output: 197 | 198 |
    199 | 200 | 201 |
    202 | 203 | ### Setting an ID for Input Type "submit" 204 | 205 | Submit inputs will not have an ID by default. However, you can set an ID in your template, e.g.: 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | The above will result in the following output: 214 | 215 |
    216 | 217 |
    218 | 219 | ### Using Redirect Parameters 220 | 221 | When calling the `input-submit` template, you may specifiy a "redirect upon success" location as well: 222 | 223 | 224 | 225 | 226 | 227 | 228 | At the time of writing I am not sure if all Members events support redirects, so it may be a matter of trial end error. 229 | 230 | You should keep in mind that POST values will not "survive" a redirect. So they will not show up in the target page's event XML. 231 | 232 | 233 | ## Namespace 234 | 235 | `members.forms.xsl` uses the namespace `members` for form elements and validation templates. So if you want to use these directly in your own pages or utilities, you will have to include the namespace: 236 | 237 | 241 | 242 | 243 | ## Additional Information 244 | 245 | These XSLT utilities are based on a precise analysis of the Members extension's fields and events. Especially event XML errors and post values needed to be understood. The essence is the following: 246 | 247 | ### Errors per Event 248 | 249 | Activate Account 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | Regenerate Activation Code 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | Generate Recovery Code 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | Reset Password 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | New/Edit 290 | 291 | Entry encountered errors when saving. 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | Member Login Info (pseudo event) 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | ### Errors per Field 311 | 312 | Password 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | Username 322 | 323 | 324 | 325 | 326 | 327 | 328 | Email 329 | 330 | 331 | 332 | 333 | 334 | 335 | Activation 336 | 337 | 338 | 339 | 340 | 341 | 342 | Generic (no dedicated form field) 343 | 344 | 345 | 346 | 347 | 348 | 349 | ### Event XML Post Values 350 | 351 | 352 | 383a59f08a2e9d057e7c13f48bb9d5d4c50664f4 353 | 97b899059e3a6497ab377a238fa137b0a2e4238c 354 | 355 | Hello 356 | hello@example.com 357 | 7787cc711acefef8bb6c4bbd0257b583656e757d 358 | 359 | HelloPassword 360 | HelloPassword 361 | 70b9a071758b7753552dddf4888664ca8dc2bb73 362 | 363 | 364 | 365 | --------------------------------------------------------------------------------