Introduction
Smart Members addon is use to all member profile addition, view or modifications.
This addon gives user friendly environment to user as well as easy to use methods that increases the quality of addon as well.
Compatibility
EE Compatible Version: EE2, EE4, EE5, EE6.
The addon contains module like Register member, Edit profile, Forgot password, Reset password, View profile, delete profile etc.
Modules
Registration / Edit profile
- Contains in-built static fields and custom fields created by user.
- Captcha facility
- Google Re-captcha v2 facility.
- Accept term as required field.
- Can choose email as username.
- Extra validations on email and username to identify uniqueness on same screen instead of EE gray screen.
- Errors can display in site as inline or outline both.
- All validation rules of codeigniter applied for field validation.
- All 3 static image upload facility i.e., Avatar Image, Signature Image, Photo File
- Instant mail as per users requirement and fields with extra EE code that will support by template parser. Email will send after convert full page from EE to HTML.
- If user put down into Pending mode, the email will sent after user activate.
- Inline errors to put error on same screen without loosing POST data.
- Extra XID and CSRF token field in hidden in all forms to not loose basic dependency for EE 2.X.
- Parameters to control form ID, Class, Attributes etc.
- Parameter to control form to submit and/or return to secure URL.
Login
- Can login with email or username.
- Remember me option to remember user.
- In page rules to check the username and password availability so it will not redirect default EE gray screen.
- Parameters, Attributes, secure action/return same as registration.
- Login to give 3rd optional parameter with username and password (Group ID). Sometimes useful to login when a specific member group needs to login from selection method.
Forgot Password
- Check existence of email.
- Email Reset URL with Key to user.
- Can set expiration time of key from backend.
- Set Reset password template, Forgot password email template, subject, message, reset URL from backend as well as frontend.
- Can use any EE tags with email template to send mail from frontend as well as backend.
- Parameters, Attributes, secure action/return same as registration.
Reset Password
- Reset the password from Key.
- Parameters, Attributes, secure action/return same as registration.
View Profile
- Tags name with field name to display values i.e.,{first_name}
- Tags name append with “_label” to display labels defined in backend i.e.,{first_name_label}
- List total field variable to view every field that is entered by user. (Used in email template).
Delete Profile
- Delete member profile by entering his/her password.
- All data of member entered in site will also delete with profile.
- Parameters, Attributes, secure action/return same as registration.
Hooks
We have created 13 hooks all over the module to control the functionality and flow by any extension developer without modifying core code of addon.
Note: We are not providing support for EE2.
Installation
Follow below steps to install Smart Members Pro version:
EE2:
- Download and Extract ZIP file of the module. (We recommend to use the latest version.)
- Copy Smart_Members_Pro > EE2 > system > expressionengine > third_party > smart_members folder to “Your Site > system > expressionengine > third_party” Folder.
- Copy Smart_Members_Pro > EE2 > themes > third_party > smart_members folder to “Your Site > themes > third_party” Folder.
- Login to backend panel with Super admin credentials.
- Go to “Add-Ons > Modules” and Install Smart Members PRO module.
EE4, EE5, EE6:
- Download and Extract ZIP file of the module. (We recommend to use the latest version.)
- Copy Smart_Members_Pro > EE4-EE5-EE6 > system > user > addons > smart_members folder to “Your Site > system > user > addons” Folder.
- Copy Smart_Members_Pro > EE4-EE5-EE6 > themes> user > smart_members folder to “Your Site > themes > user” Folder.
- Login to backend panel with Super admin credentials.
- Go to “Developer > Add-Ons” and Install Smart Members PRO module.
Note: If you purchased the addon from Devot:ee then you can get the license key from the licenses tab in your profile.
Validation Rules
To submit any form you need some rules to give inputs.
This is the list of rules you can use for fields.
- required
- Returns FALSE if the form field is empty.
- valid_email
- Returns FALSE if the form field does not contain a valid email address.
- valid_emails
- Returns FALSE if any value provided in a comma separated list is not a valid email.
- min_length
- Returns FALSE if the form field is shorter than the parameter value.
- Example: min_length[5]. Where 5 is a parameter of length.
- max_length
- Returns FALSE if the form field is longer than the parameter value.
- Example: max_length[10]. Where 10 is a parameter of length.
- exact_length
- Returns FALSE if the form field is not exactly the parameter value.
- Example: exact_length[10]. Where 10 is a parameter of length.
- matches
- Returns FALSE if the form field does not match the defined value of parameter.
- Example: matches[field]. Where field is parameter name of field to match with.
- Alpha
- Returns FALSE if the form field contains anything other than alphabetical characters.
- alpha_numeric
- Returns FALSE if the form field contains anything other than alpha-numeric characters.
- alpha_dash
- Returns FALSE if the field contains anything other than alpha-numeric characters, underscores or dashes.
- numeric
- Returns FALSE if the form field contains anything other than numeric characters.
- integer
- Returns FALSE if the form field contains anything other than an integer.
- decimal
- Returns FALSE if the form field contains anything other than a decimal number.
- is_natural
- Returns FALSE if the form field contains anything other than a natural number.
- is_natural_no_zero
- Returns FALSE if the form field contains anything other than a natural number, but not zero.
- valid_ip
- Returns FALSE if the supplied IP is not valid.
- sm_captcha_validate
- Returns FALSE if the EE Captcha is not valid. (Default for EE captcha field.)
- is_unique
- Returns FALSE id the field value match with the field in database table.
- Example: is_unique[members.email]. Where “members” is table name and “email” is field of that table.
- exists_email
- Returns FALSE if email field entered by user is not exists in members table.
- Used in forgot password form email field by default.
- auth_password
- Returns FALSE if user entered wrong password.
- Use in edit profile form to validate current password.
Hooks
Smart Members: Hooks
Hooks are use to modify the data or writing your own flow on addon without changing the core code of addon. List of hooks given in smart members are listed below:
- Build form starts:
- Build forms ends:
- Start submit forms:
- End submit forms:
- If errors found in forms:
- Initialize validation rules:
- View profile start
- Before send email:
- Total fields listed (Constructor Hook)
- Social Media login (Pro Feature)
- Import member Hooks (Pro Feature [EE4 only])
- You can also use ExpressionEngine default hooks given below:
- member_member_register_start
- member_member_register_errors
- member_member_register
- member_member_logout
- member_delete
- member_update_start
- member_update_end
- cp_members_validate_members
- member_register_validate_members
sm_build_form_start
This hook will call every time a forms build start. This hook let user to modify data before form generates.
Hook Name | sm_build_form_start |
Parameter 1 | Source: Actual source of form.[i.e, “registration”, “edit_profile”, “forgot_password”, “reset_password”] |
Parameter 2 | Total Fields: Array of total possible fields. |
Return | Total Fields. |
sm_before_logout_link
This hook will call when generates logout url from {exp:smart_members:logout}.
It has Logout URL in parameter of hook function.
Hook Name | sm_before_logout_link |
Parameter | Logout URL |
Return | Logout URL |
sm_build_form_end
This hook will call every time a forms ends build. This hook will call before replace the actual data with tagdata. The parameter contains Source and the Variable array of form.
Hook Name | sm_build_form_end |
Parameter 1 | Source: Actual source of form.[i.e, “registration”, “edit_profile”, “forgot_password”, “reset_password”] |
Parameter 2 | Variable array of form parameters and hidden fields. |
Return | Variable array of form parameters and hidden fields. |
sm_submit_form_start
This hook will call when user submits a form. This hook will call before validation hook.
Hook Name | sm_submit_form_start |
Parameter 1 | Source: Actual source of form.[i.e, “registration”, “edit_profile”, “forgot_password”, “reset_password”] |
Parameter 2 | Parameter array passed in exp loop of form |
Return | Parameter array passed in exp loop of form |
sm_logout_start
This hook will call when a user click on logout URL. The data passed in parameter is the GET array which can secure action parameter or return url.
Hook Name | sm_logout_start |
Parameter | GET array |
Return | GET array |
sm_submit_form_end
This hook will call when we submits a form without any error and it update the form data into database.
Hook Name | sm_submit_form_end |
Parameter 1 | Source: Actual source of form.[i.e, “registration”, “edit_profile”, “forgot_password”, “reset_password”] |
Parameter 2 | Return URL |
Return | Return URL |
sm_error_in_form
This hook will call when we found errors in our forms submitted data.
Hook Name | sm_error_in_form |
Parameter 1 | Source: Actual source of form.[i.e, “registration”, “edit_profile”, “forgot_password”, “reset_password”] |
Parameter 2 | Array of errors |
Return | Array of errors |
sm_outer_error
It is possible that error occurs in the form of the field of some xyz field and you forgot to add {error:xyz} in form. In that case error will show in ee default gray screen.
(Only called if error_reporting=”inline” is passed as parameter in form)
Hook Name | sm_outer_error |
Parameter 1 | Source: Actual source of form.[i.e, “registration”, “edit_profile”, “forgot_password”, “reset_password”] |
Parameter 2 | Array of errors |
Return | Array of errors |
sm_init_validation
This hook will call before initialization of validation array to field. So you can control rules of fields before assign rules to fields.
Hook Name | sm_init_validation |
Parameter 1 | Source: Actual source of form.[i.e, “registration”, “edit_profile”, “forgot_password”, “reset_password”] |
Parameter 2 | Array of validation array (Form settings) |
Return | Array of validation array (Form settings) |
sm_view_profile_start
This hook will call when you trigger {exp:smart_members:profile} tag.
Hook Name | sm_view_profile_start |
Parameter | NA |
Return | NA |
sm_view_profile_end
This hook will call before the actual profile data will replace with tagdata.
It will pass member data array in parameter and accept the same as return.
Hook Name | sm_view_profile_end |
Parameter | Array of member data |
Return | Array of member data |
sm_before_send_email
This hook will call before any email sends with smart members. i.e., Registration email, forgot password email.
Hook Name | sm_before_send_email |
Parameter 1 | Source: Actual source of form.[i.e, “registration”, “edit_profile”, “forgot_password”, “reset_password”] |
Parameter 2 | Array of validation array (Form settings) |
Return | Array of validation array (Form settings) |
sm_total_fields
This is constructor hook. All possible fields that can exists in form or profile can contains. Array of this field is parameter of this hook.
Hook Name | sm_total_fields |
Parameter | Array of total possible fields a form can contains. |
Return | Array of total possible fields a form can contains. |
sm_element_before_import (Pro Feature [EE4 >= v2.0.3])
This hook will call just before member will insert or update in database. Hook has one parameter that contains array that going to be insert/update so one can modify member data before insert it into the database.
Hook Name | sm_element_before_import |
Parameter | Full Array that going to be save in database. |
Return | Same array after modification. |
sm_element_after_import (Pro Feature [EE4 >= v2.0.3])
This hook will call just after member will save in database. Hook has one parameter that contains array that just saved into the database and second parameter as member_id which holds the data.
Hook Name | sm_element_after_import |
Parameter 1 | Full Array that saved in database. |
Parameter 2 | Member ID holding particular member. |
Return | NA |
Basic setting
Basic settings allows you to customize addon settings as per your requirements. Form is easy to understand and settings will effect in every module we use in frontend.
Setting form allows you to mark username as password, override screen name field, set registration email template and forgot password email template, set reset password template etc.
Basic setting form (Default view)
There are multiple fields that can change as per your requirements. Details about those fields are given below:
-
- Use email address as username:
This field can be use to have same value for both username and email field. Checking this to YES will no longer need email field in registration page. You only need to use username field and put the type as email so one can not enter the text input rather then email address.Example:<input type="email" name="username" placeholder="Email Address"> {error:username} //if error_reporting="inline"
Note “type” of input is “email” and “name” of input is “username”. Same will follow in edit profile module.
- Email template for new registrations:
You have 2 options here. You can either put every code of email templates for registrations and forgot password in backend setting form or you can generate template to frontend.
Select “Default” if you want to use backend setting form email templates for send emails.
Select front end template if you want to generate your own templates to send emails to user. Select the templates from front end is necessary for this option. - Screen name override:
This option allows you to use any custom field as Screen name. That will took the field on registration process and override screen name.As screen name field must be unique, If one take a field name and that name is already in screen name field of any other user, the default screen name will use instead of override. - Enable Re-captcha ?Enabling this will ask you recaptcha key and secret. You can generate recaptcha key and secret from google recaptcha site.
URL: https://www.google.com/recaptcha/admin#list
Enter your domain and generate key and secret. You can then use google recaptcha in your front end module by entering enable_recaptcha=”yes” in parameter and code of google recaptcha in template:{if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"><label for="recaptcha">Click the checkbox</label> {recaptcha} {error:recaptcha} </p> {/if}
- Use email address as username:
Captcha and recaptcha to use in if else condition is helpful in case if you pass enable_recaptcha=”yes” in parameter and not give API key and Secret in backend setting form. In such case it will display normal captcha in place of recaptcha.
- Email template setting:
If you choose Email template for new registrations to default, You need to pass the email settings in form at down otherwise you only need to select the email templates.
Basic Settings (Email template view)
Member preferences
Member preferences setting form is only developed for EE3 users as static images such as Photo file and Signature Image fields settings of path, height, width etc. Settings are available in member preferences in EE2, But such setting forms are not available for EE3 right now.
“Allow avatars?” and “Allow avatars?” setting is removed from EE6 because EE6 makes it compulsory to enable avatars for members.
You can simply adjust the settings for photo file, avatar and signature image settings from this module.
Member Preferences setting form
Social Settings
Social Login provides users to login with their social accounts. User can use login with Facebook, Twitter, Google and 20 more Social sites to login.
Social Settings List page
Every Social login API will ask for a callback URL. You can found a Callback URL at social Settings List page.
Callback URL:
Test the link is working or not by clicking TEST button at right. If link is not working please do check the link path is correct or not.
If Test goes success, You will see this page:
Social Settings Form:
Available Social sites:
- Live
- Yahoo
- Foursquare
- GitHub
- px500
- BitBucket
- Disqus
- Dribbble
- Dropbox
- GitLab
- LastFM
- MailChimp
- Slack
- SoundCloud
- Vimeo
- Tumblr
To activate Facebook method in Social Login settings:
- Generate Application ID and Application Secret From this link: https://developers.facebook.com/quickstarts/?platform=web
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need. Facebook API need exact callback URL. So you need to enter the callback URL with done parameter. ( EX: if your callback URL is http://www.example.com/?ACT=85, Your callback URL for facebook will be http://www.example.com/?ACT=229&hauth_done=Facebook
- Once you generate Application ID and Application Secret, Go to social settings page in Smart Members Pro and Edit Facebook settings.
- Put your Application ID and Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
To activate Twitter method in Social Login settings:
- Generate Consumer key and Consumer Secret From this link: https://apps.twitter.com/app/new
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Consumer key and Consumer Secret, Go to social settings page in Smart Members Pro and Edit Twitter settings.
- Put your Consumer key and Consumer Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
To activate Google method in Social Login settings:
- Generate Client ID andClient Secret From this link: https://console.developers.google.com/
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need. Google API need exact callback URL. So you need to enter the callback URL with done parameter. ( EX: if your callback URL is http://www.example.com/?ACT=85, Your callback URL for Google will be http://www.example.com/?ACT=85&hauth.done=Google
- Once you generate Client ID andClient Secret, Go to social settings page in Smart Members Pro and Edit Google settings.
- Put your Client ID and Client Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
Live
To activate Live method in Social Login settings:
- Generate Client ID and Client Secret From this link: https://apps.dev.microsoft.com/#/appList/create/sapi
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Client ID and Client Secret, Go to social settings page in Smart Members Pro and Edit Live settings.
- Put your Client ID and Client Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
Yahoo
To activate Yahoo method in Social Login settings:
- Generate Client ID and Client Secret From this link: https://developer.yahoo.com/apps/create/
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Client ID and Client Secret, Go to social settings page in Smart Members Pro and Edit Yahoo settings.
- Put your Client ID and Client Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
Foursquare
To activate Foursquare method in Social Login settings:
- Generate Client ID and Client Secret From this link: https://foursquare.com/developers/apps
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Client ID and Client Secret, Go to social settings page in Smart Members Pro and Edit Foursquare settings.
- Put your Client ID and Client Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
GitHub
To activate GitHub method in Social Login settings:
- Generate Client ID and Client Secret From this link: https://github.com/settings/applications/new
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Client ID and Client Secret, Go to social settings page in Smart Members Pro and Edit GitHub settings.
- Put your Client ID and Client Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
px500
To activate px500 method in Social Login settings:
- Generate Customer ID and Customer Secret From this link: https://500px.com/settings/applications
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Customer ID and Customer Secret, Go to social settings page in Smart Members Pro and Edit px500 settings.
- Put your Customer ID and Customer Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
BitBucket
To activate BitBucket method in Social Login settings:
- Generate Customer Key and Customer Secret From this link: https://bitbucket.org/account/user/testing_eecms/api
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Customer Key and Customer Secret, Go to social settings page in Smart Members Pro and Edit BitBucket settings.
- Put your Customer Key and Customer Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
Disqus
To activate Disqus method in Social Login settings:
- Generate Public Key and Secret Key From this link: https://disqus.com/api/applications/register/
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Public Key and Secret Key, Go to social settings page in Smart Members Pro and Edit Disqus settings.
- Put your Public Key and Secret Key in their fields. Select the callback URL you have put in API.
- Save the settings.
Dribbble
To activate Dribbble method in Social Login settings:
- Generate Client ID and Client Secret From this link: https://dribbble.com/account/applications/new
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Client ID and Client Secret, Go to social settings page in Smart Members Pro and Edit Dribbble settings.
- Put your Client ID and Client Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
Dropbox
To activate Dropbox method in Social Login settings:
- Generate App Key and App Secret From this link: https://www.dropbox.com/developers/apps/create
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate App Key and App Secret, Go to social settings page in Smart Members Pro and Edit Dropbox settings.
- Put your App Key and App Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
GitLab
To activate GitLab method in Social Login settings:
- Generate Application ID and Application Secret From this link: https://gitlab.com/oauth/applications
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Application ID and Application Secret, Go to social settings page in Smart Members Pro and Edit GitLab settings.
- Put your Application ID and Application Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
To activate Instagram method in Social Login settings:
- Generate Client ID and Client Secret From this link: https://www.instagram.com/developer/clients/register/
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Client ID and Client Secret, Go to social settings page in Smart Members Pro and Edit Instagram settings.
- Put your Client ID and Client Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
LastFM
To activate LastFM method in Social Login settings:
- Generate API key and Shared Secret From this link: http://www.last.fm/api/account/create
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate API key and Shared Secret, Go to social settings page in Smart Members Pro and Edit LastFM settings.
- Put your API key and Shared Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
MailChimp
To activate MailChimp method in Social Login settings:
- Generate Client ID and Client Secret From this link: https://us14.admin.mailchimp.com/account/oauth2/client/
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Client ID and Client Secret, Go to social settings page in Smart Members Pro and Edit MailChimp settings.
- Put your Client ID and Client Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
Slack
To activate Slack method in Social Login settings:
- Generate Client ID and Client Secret From this link: https://api.slack.com/apps/new
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Client ID and Client Secret, Go to social settings page in Smart Members Pro and Edit Slack settings.
- Put your Client ID and Client Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
SoundCloud
To activate SoundCloud method in Social Login settings:
- Generate Client ID and Client Secret From this link: http://soundcloud.com/you/apps/new
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Client ID and Client Secret, Go to social settings page in Smart Members Pro and Edit SoundCloud settings.
- Put your Client ID and Client Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
Vimeo
To activate Vimeo method in Social Login settings:
- Generate Client ID and Client Secret From this link: https://developer.vimeo.com/apps/new
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate Client ID and Client Secret, Go to social settings page in Smart Members Pro and Edit Vimeo settings.
- Put your Client ID and Client Secret in their fields. Select the callback URL you have put in API.
- Save the settings.
Tumblr
To activate Tumblr method in Social Login settings:
- Generate OAuth consumer key and OAuth consumer secret From this link: https://www.tumblr.com/oauth/register
- Enter Callback URL in API form. You can enter Default callback URL or Custom Callback URL as per your need.
- Once you generate OAuth consumer key and OAuth consumer secret, Go to social settings page in Smart Members Pro and Edit Tumblr settings.
- Put your OAuth consumer key and OAuth consumer secret in their fields. Select the callback URL you have put in API.
- Save the settings.
Member Fields
ExpressionEngine has limit for member field types. One can only select Text Input, Textarea and select dropdown as custom member fields. We introduce Multi select box, Radio buttons, Checkboxes and File fields to use as custom member fields.
Member Fields setting List Page:
Create Field form:
Export member
You can now export members with selected fields filtered by Groups. Exports are available to download in both CSV and XML format. You can save the exports to use it in future. Export can also made by out side of admin panel with auto generated links.
Export member List page:
You can download, edit or Delete the exports from here. URL link is will popup the external URL to download export from outsite of EE. There is some security to download exports from outside of EE. If you make export private, No once can download it without login with your account. Public exports can download from outside of EE with anyone who logged in. If you want to download export from outside of EE without login, set “Access export URL without Login ?” to YES.
Popup URL to download export outside of EE:
Generate Export Form 1:
Generate Export Form 2:
Import Members
One can import members with selected fields with filtration. Filtration is done on many basis such as same email, same member ID, same screen name, Sanitize the unique fields or not etc. Import can done from both CSV and XML files at path of both server path or URL. You can save the imports to use it in future. Imports can also done by out side of admin panel with auto generated links.
Import Members List page:
You can run, edit or Delete the imports from here. URL link is will popup the external URL to run export from outsite of EE. There is some security to run imports from outside of EE. If you make import private, No once can run it without login with your account. Public imports can run from outside of EE with anyone who logged in. If you want to run import from outside of EE without login, set “Access import URL without Login ?” to YES.
Popup URL to run import outside of EE:
Import Member Choose fields:
Import Member setup Configurations:
Run Import page inside EE:
Run Import page outside EE:
Custom Sidebar
We provide one “customSidebar” function in the MCP file. You can add more menus in the sidebar of the addon using this function.
/* To get dynamic menu in the addon */ function customSidebar(){ $sidebar = ee('CP/Sidebar')->make(); $this->navSettings = $sidebar->addHeader('Test Link', ''); }
Registration
Registration module is use for register a user with your site. A registration module will process and react as per settings we have passed in member preferences and addon setting form.
Tag for registration module will look like this.
{exp:smart_members:register} Content data {/exp:smart_members:register}
Parameters
- group_id
- role_id
- allowed_groups
- rule:FIELD_NAME
- attr:ATTRIBUTES
- return
- error_reporting
- wrap_errors
- on_submit
- secure_action
- secure_return
- enable_recaptcha
Fields
- group_id
- username
- password
- password_confirm
- avatar_filename
- photo_filename
- sig_img_filename
- yahoo_im
- url
- location
- occupation
- interests
- aol_im
- msn_im
- icq
- bio
- signature
- captcha
- CUSTOM_FIELD
- CUSTOM_CHECKBOX_FIELD (Pro Feature)
- CUSTOM_RADIO_FIELD (Pro Feature)
- CUSTOM_MULTI_SELECT_FIELD (Pro Feature)
- CUSTOM_FILE_FIELD (Pro Feature)
Following Parameters can be use in Registration form
group_id (For <= EE5)
Group id of member groups to put the member in any specific group.
Example:
group_id = "5"
role_id (For EE6)
Primary role id of member to put the member in any specific primary role.
Example:
role_id = "5"
allowed_groups
Allowed groups parameter is used to give options to member for select any group from them. Use input field of group_id to enter the group id from defined allowed groups.
For EE6, you will pass the primary role ID to this parameter.
Example:
allowed_groups = "5|6|7"
rule:FIELD_NAME
Rule parameter is use to give custom rules to fields separate by pipe ( | ).
Example:
rule:username = "required" rule:email = "required|valid_email|is_unique[members.email]"
attr:ATTRIBUTES
Parameter to add attributes in form. We can add classes, ids etc.
Example:
attr:id = "form_id" attr:class = "form_class" attr:name = "form_name" attr:data-id = "form_data_id"
return
Return to any specific page after successful submission of form.
Example:
return = "smart-members/profile"
error_reporting
Error reporting format is defined by this parameter. It can be either “inline” or “outline”.
“Inline” error reporting will show the error in same page.
“outline” error reporting will show error in EE gray box in new page.
Example:
error_reporting="inline"
wrap_errors
Use this parameter to wrap forms error in any span or div if set error_reporting=”inline”.
Example:
wrap_errors="<span class='error-inline'>|</span>"
on_submit
This parameter allows us to call any Javascript function on submit of form
Example:
on_submit="call_me( )"
secure_action
Secure action will post the data on secure site i.e., https
Example:
secure_action="yes"
secure_return
Secure return will return the page after submit of form on secure site i.e., https
Example:
secure_return="yes"
enable_recaptcha
This parameter enables recaptcha instead of normal captcha.
- Scenario EE2:
- If this parameter is set and API key and SECRET is not passed for recaptcha in backend, The normal captcha will show.
- If recaptcha API key and SECRET is passed in backend and this parameter not set:
- If the page is registration page and you have set captcha as required from member preferences, normal captcha will show.
- If the page is not registration page, neither captcha or recaptcha will show.
- If recaptcha API key and SECRET is passed in backend and this parameter is set:
- If the page is registration page and you have set captcha as required from member preferences, The normal captcha will not show and recaptcha will override the settings.
- If the page is not registration page, recaptcha will show.
- Scenario EE3:
- Same scenario like EE2. Only change is, there is backend member preference settings in EE3 that allows to not enter any captcha if member is logged in. So if you set this parameter and API key and SECRET is also passed, If you are logged in this recaptcha or captcha will not show until you set “Require CAPTCHA while logged in?” to “Yes” from backend member settings > captcha settings.
Example:
enable_recaptcha="yes"
Different methods that can be use by user are given below.
Input
<input type="email" name="username" placeholder="Email Address"> {error:username} //if error_reporting="inline"
Textarea
<textarea name="signature"></textarea> {error:signature} //if error_reporting="inline"
Default File field (Avatar, Photo and Signature files)
<input type="file" name="avatar_filename" /> {error:avatar_filename} //if error_reporting="inline"
Select Dropdown: (For member group) (For <= EE5)
{data_group_id} {if data_group_id:count == 1} <select name="group_id"> <option value=""></option> {/if} <option value = "{group_id_value}" > {group_id_label}</option> {if data_group_id:count == data_group_id:total_results} </select> {error:group_id} //if error_reporting="inline" {/if} {/data_group_id}
Select Dropdown: (For member primary role) (For EE6)
{data_group_id} {if data_group_id:count == 1} <select name="role_id"> <option value=""></option> {/if} <option value = "{group_id_value}" > {group_id_label}</option> {if data_group_id:count == data_group_id:total_results} </select> {error:role_id} //if error_reporting="inline" {/if} {/data_group_id}
Select Dropdown: (For custom field)
{data_CUSTOM_FIELD} {if data_CUSTOM_FIELD:count == 1} <select name="CUSTOM_FIELD"> <option value=""></option> {/if} <option value = "{CUSTOM_FIELD_value}"> {CUSTOM_FIELD_label} </option> {if data_CUSTOM_FIELD:count == data_CUSTOM_FIELD:total_results} </select> {error:CUSTOM_FIELD} //if error_reporting="inline" {/if} {/data_CUSTOM_FIELD}
Captcha
{if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"> <label for="recaptcha">Click the checkbox</label>{recaptcha} {error:recaptcha} </p> {/if}
Accept terms
<input type="checkbox" name="accept_terms" value="y" /> Accept Terms? {error:accept_terms} //if error_reporting="inline"
CUSTOM_CHECKBOX_FIELD (Pro Feature)
{data_CUSTOM_CHECKBOX_FIELD} {if data_CUSTOM_CHECKBOX_FIELD:count == 1} <p style="display: inline-flex; "> {/if} <input type="checkbox" name="CUSTOM_CHECKBOX_FIELD[]" value="{CUSTOM_CHECKBOX_FIELD_value}" id="test_{data_CUSTOM_CHECKBOX_FIELD:count}" {if CUSTOM_CHECKBOX_FIELD_value:exists}checked{/if}> <label for="test_{data_CUSTOM_CHECKBOX_FIELD:count}">{CUSTOM_CHECKBOX_FIELD_label}</label> {if data_CUSTOM_CHECKBOX_FIELD:count == data_CUSTOM_CHECKBOX_FIELD:total_results} {error:CUSTOM_CHECKBOX_FIELD} </p> {/if} {/data_CUSTOM_CHECKBOX_FIELD}
CUSTOM_RADIO_FIELD (Pro Feature)
{data_CUSTOM_RADIO_FIELD} {if data_CUSTOM_RADIO_FIELD:count == 1} <p style="display: inline-flex;"> {/if} <input type="radio" name="CUSTOM_RADIO_FIELD" value="{CUSTOM_RADIO_FIELD_value}" id="test_{data_CUSTOM_RADIO_FIELD:count}" {if CUSTOM_RADIO_FIELD_value:exists}checked{/if}> <label for="test_{data_CUSTOM_RADIO_FIELD:count}">{CUSTOM_RADIO_FIELD_label}</label> {if data_CUSTOM_RADIO_FIELD:count == data_CUSTOM_RADIO_FIELD:total_results} {error:CUSTOM_RADIO_FIELD} </p> {/if} {/data_CUSTOM_RADIO_FIELD}
CUSTOM_MULTI_SELECT_FIELD (Pro Feature)
{data_CUSTOM_MULTI_SELECT_FIELD} {if data_CUSTOM_MULTI_SELECT_FIELD:count == 1} <p style="display: inline-flex; "> <select multiple name="CUSTOM_MULTI_SELECT_FIELD[]"> {/if} <option value="{CUSTOM_MULTI_SELECT_FIELD_value}" {if CUSTOM_MULTI_SELECT_FIELD_value:exists}selected{/if}>{CUSTOM_MULTI_SELECT_FIELD_label}</option> {if data_CUSTOM_MULTI_SELECT_FIELD:count == data_CUSTOM_MULTI_SELECT_FIELD:total_results} </select> {error:CUSTOM_MULTI_SELECT_FIELD} </p> {/if} {/data_CUSTOM_MULTI_SELECT_FIELD}
CUSTOM_FILE_FIELD (Pro Feature)
<p> Old file name: {CUSTOM_FILE_FIELD}<br> <input type="file" name="CUSTOM_FILE_FIELD"> {error:CUSTOM_FILE_FIELD} </p>
Example (For <= EE5):
{exp:smart_members:register allowed_groups="6|7|5" rule:username="required|valid_email|min_length[5]" rule:password="required|matches[password_confirm]|min_length[5]" rule:password_confirm="required|min_length[5]" rule:group_id="required" rule:state="required" rule:first_name="required" attr:id="registration_id" attr:class="registration_class" attr:name="registration-form" attr:data-id="registration_data_id_attr" return="smart-members/edit-profile" enable_recaptcha="yes" error_reporting="inline" wrap_errors="<span class='error-inline'>|</span>" on_submit="registration()" } <p> <input type="text" name="CUSTOM_FIELD" placeholder="CUSTOM FIELD"> {error:CUSTOM_FIELD} </p> {data_group_id} {if data_group_id:count == 1} <p> <select name="group_id"> <option value=""></option> {/if} <option value="{group_id_value}">{group_id_label}</option> {if data_group_id:count == data_group_id:total_results} </select> {error:group_id} </p> {/if} {/data_group_id} <p> <input type="text" name="username" placeholder="Username"> {error:username} </p> <p> <input type="text" name="email" placeholder="Email Address"> {error:email} </p> <p> <input type="password" name="password" placeholder="Password"> {error:password} </p> <p> <input type="password" name="password_confirm"> {error:password_confirm} </p> <p> <input type="file" name="avatar_filename" /> {error:avatar_filename} </p> {if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"> <label for="recaptcha">Click the checkbox</label> {recaptcha} {error:recaptcha} </p> {/if} <p> <input type="checkbox" name="accept_terms" value="y" /> Accept Terms? {error:accept_terms} </p> <div class="register-register-click cf"> <input type="submit" class="register" value="Register"> </div> {/exp:smart_members:register}
Example (For EE6):
{exp:smart_members:register allowed_groups="6|7|5" rule:username="required|valid_email|min_length[5]" rule:password="required|matches[password_confirm]|min_length[5]" rule:password_confirm="required|min_length[5]" rule:role_id="required" rule:state="required" rule:first_name="required" attr:id="registration_id" attr:class="registration_class" attr:name="registration-form" attr:data-id="registration_data_id_attr" return="smart-members/edit-profile" enable_recaptcha="yes" error_reporting="inline" wrap_errors="<span class='error-inline'>|</span>" on_submit="registration()" } <p> <input type="text" name="CUSTOM_FIELD" placeholder="CUSTOM FIELD"> {error:CUSTOM_FIELD} </p> {data_group_id} {if data_group_id:count == 1} <p> <select name="role_id"> <option value=""></option> {/if} <option value="{group_id_value}">{group_id_label}</option> {if data_group_id:count == data_group_id:total_results} </select> {error:role_id} </p> {/if} {/data_group_id} <p> <input type="text" name="username" placeholder="Username"> {error:username} </p> <p> <input type="text" name="email" placeholder="Email Address"> {error:email} </p> <p> <input type="password" name="password" placeholder="Password"> {error:password} </p> <p> <input type="password" name="password_confirm"> {error:password_confirm} </p> <p> <input type="file" name="avatar_filename" /> {error:avatar_filename} </p> {if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"> <label for="recaptcha">Click the checkbox</label> {recaptcha} {error:recaptcha} </p> {/if} <p> <input type="checkbox" name="accept_terms" value="y" /> Accept Terms? {error:accept_terms} </p> <div class="register-register-click cf"> <input type="submit" class="register" value="Register"> </div> {/exp:smart_members:register}
Login
Login module is use for login the registered member. ExpressionEngine also provides default Login module. We are giving the Login module to provide the additional features the addon provides such as Inline error reporting, Recaptcha, Login with either Username or Email address etc.
Tag for Login module will look like this.
{exp:smart_members:login} Content data {/exp:smart_members:login}
Parameters
- allowed_groups
- rule:FIELD_NAME
- attr:ATTRIBUTES
- return
- error_reporting
- wrap_errors
- on_submit
- secure_action
- secure_return
- enable_recaptcha
Fields
- group_id
- username
- password
- auto_login
- captcha
Following Parameters can be use in Login form
allowed_groups
Allowed groups parameter is used to give options to member for select any group from them. Use input field of group_id to enter the group id from defined allowed groups.
For EE6, you will pass the primary role ID to this parameter.
Example:
allowed_groups = "5|6|7"
rule:FIELD_NAME
Rule parameter is use to give custom rules to fields separate by pipe ( | ).
Example:
rule:username = "required" rule:email = "required|valid_email|is_unique[members.email]"
attr:ATTRIBUTES
Parameter to add attributes in form. We can add classes, ids etc.
Example:
attr:id = "form_id" attr:class = "form_class" attr:name = "form_name" attr:data-id = "form_data_id"
return
Return to any specific page after successful submission of form.
Example:
return = "smart-members/profile"
error_reporting
Error reporting format is defined by this parameter. It can be either “inline” or “outline”.
“Inline” error reporting will show the error in same page.
“outline” error reporting will show error in EE gray box in new page.
Example:
error_reporting="inline"
wrap_errors
Use this parameter to wrap forms error in any span or div if set error_reporting=”inline”.
Example:
wrap_errors="<span class='error-inline'>|</span>"
on_submit
This parameter allows us to call any Javascript function on submit of form
Example:
on_submit="call_me( )"
secure_action
Secure action will post the data on secure site i.e., https
Example:
secure_action="yes"
secure_return
Secure return will return the page after submit of form on secure site i.e., https
Example:
secure_return="yes"
enable_recaptcha
This parameter enables recaptcha instead of normal captcha.
- Scenario EE2:
- If this parameter is set and API key and SECRET is not passed for recaptcha in backend, The normal captcha will show.
- If recaptcha API key and SECRET is passed in backend and this parameter not set:
- If the page is registration page and you have set captcha as required from member preferences, normal captcha will show.
- If the page is not registration page, neither captcha or recaptcha will show.
- If recaptcha API key and SECRET is passed in backend and this parameter is set:
- If the page is registration page and you have set captcha as required from member preferences, The normal captcha will not show and recaptcha will override the settings.
- If the page is not registration page, recaptcha will show.
- Scenario EE3:
- Same scenario like EE2. Only change is, there is backend member preference settings in EE3 that allows to not enter any captcha if member is logged in. So if you set this parameter and API key and SECRET is also passed, If you are logged in this recaptcha or captcha will not show until you set “Require CAPTCHA while logged in?” to “Yes” from backend member settings > captcha settings.
Example:
enable_recaptcha="yes"
Different methods that can be use by user are given below.
Input
<input type="email" name="username" placeholder="Email Address"> {error:username} //if error_reporting="inline"
Select Dropdown: (For member group)
Notes: You will use the below script for EE6.
{data_group_id} {if data_group_id:count == 1} <select name="group_id"> <option value=""></option> {/if} <option value = "{group_id_value}" > {group_id_label}</option> {if data_group_id:count == data_group_id:total_results} </select> {error:group_id} //if error_reporting="inline" {/if} {/data_group_id}
Captcha
{if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"> <label for="recaptcha">Click the checkbox</label>{recaptcha} {error:recaptcha} </p> {/if}
Auto Login
<input type="checkbox" name="auto_login" value="y" /> Remember me? {error:auto_login} //if error_reporting="inline"
Example:
{exp:smart_members:login rule:username="required|min_length[5]" rule:password="required" allowed_groups="1|5|7" attr:id="login_id" attr:class="login_class" attr:name="login-form" attr:data-id="login_datta_id_attr" return="/smart-members/edit-profile" error_reporting="inline" wrap_errors="<span class='error-inline'>|</span>" enable_recaptcha="yes" on_submit="login()" } {data_group_id} {if data_group_id:count == 1} <p> <select name="group_id"> <option value=""></option> {/if} <option value="{group_id_value}">{group_id_label}</option> {if data_group_id:count == data_group_id:total_results} </select> {error:group_id} </p> {/if} {/data_group_id} <p> <input type="text" name="username" class="text required validate[required]"> {error:username} </p> <p> <input type="password" name="password" class="password text required validate[required]"> {error:password} </p> {if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"> <label for="recaptcha">Click the checkbox to complete the captcha process</label> {recaptcha} {error:recaptcha} </p> {/if} <label for="auto_login"> <input type="checkbox" name="auto_login" id="auto_login" value="y" /> Auto Login {error:auto_login} </label> <div class="login-login-click cf"> <input type="submit" class="login-popup-btn login" value="Login" > </div> {/exp:smart_members:login}
Social Login
Social Login module is use for login/register a member with your site. A Social login module will react as per settings you have made in backend.
Tag for Social Login module will look like this.
{exp:smart_members:social_login} Content data {/exp:smart_members:social_login}
Parameters
- rule:FIELD_NAME
- attr:ATTRIBUTES
- return
- no_email_return
- error_reporting
- wrap_errors
- on_submit
- secure_action
- secure_return
- enable_recaptcha
- popup
- remember_me
- providers
Fields
- providers
Following Parameters can be use in Social Login form
Different methods that can be use by user are given below.
Select Dropdown (For Providers listing)
{providers} {if providers:count == 1} <p> <select name="providers"> <option value=""></option> {/if} <option value="{provider_name}">{provider_label}</option> {if providers:count == providers:total_results} </select> {error:providers} </p> {/if} {/providers}
Captcha
{if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"> <label for="recaptcha">Click the checkbox</label>{recaptcha} {error:recaptcha} </p> {/if}
Example:
{exp:smart_members:social_login providers = "facebook|twitter|google" attr:id = "sl_id" attr:class = "sl_class" attr:name = "sl-form" attr:data-id = "sl_datta_id_attr" rule:providers = "required" error_reporting="inline" wrap_errors="<span class='error-inline'>|</span>" on_submit = "sl()" return = "smart-members/profile" no_email_return = "smart-members/edit-profile" remember_me = "yes" secure_action="yes" secure_return="yes" enable_recaptcha = "yes" popup = "yes" } {providers} {if providers:count == 1} <p> <select name="providers"> <option value=""></option> {/if} <option value="{provider_name}">{provider_label}</option> {if providers:count == providers:total_results} </select> {error:providers} </p> {/if} {/providers} <div class="login-register-click cf"> <input type="submit" class="login-popup-btn register" value="Login With Social media" > </div> {/exp:smart_members:social_login}
Edit profile
Edit profile form is used to update the member static data as well as custom data. A member can also edit their profile username, email and password with this form.
Normal static fields and custom fields doesn’t require current password to update the data.
Dependent fields for login and email such as username, email and password fields needs current password to be entered to update the fields.
Tag for Edit profile module will look like this.
{exp:smart_members:edit} Content data {/exp:smart_members:edit}
Parameters
- allowed_groups
- rule:FIELD_NAME
- attr:ATTRIBUTES
- return
- error_reporting
- wrap_errors
- on_submit
- secure_action
- secure_return
- enable_recaptcha
- member_id
- allowed_admin_groups
Fields
- group_id (For <= EE5)
- role_id (For EE6)
- username
- password
- password_confirm
- avatar_filename
- photo_filename
- sig_img_filename
- yahoo_im
- url
- location
- occupation
- interests
- aol_im
- msn_im
- icq
- bio
- signature
- captcha
- CUSTOM_FIELD
- CUSTOM_CHECKBOX_FIELD (Pro Feature)
- CUSTOM_RADIO_FIELD (Pro Feature)
- CUSTOM_MULTI_SELECT_FIELD (Pro Feature)
- CUSTOM_FILE_FIELD (Pro Feature)
Following Parameters can be use in Edit Profile form
allowed_groups
Allowed groups parameter is used to give options to member for select any group from them. Use input field of group_id to enter the group id from defined allowed groups.
For EE6, you will pass the primary role ID to this parameter.
Example:
allowed_groups = "5|6|7"
rule:FIELD_NAME
Rule parameter is use to give custom rules to fields separate by pipe ( | ).
Example:
rule:username = "required" rule:email = "required|valid_email|is_unique[members.email]"
attr:ATTRIBUTES
Parameter to add attributes in form. We can add classes, ids etc.
Example:
attr:id = "form_id" attr:class = "form_class" attr:name = "form_name" attr:data-id = "form_data_id"
return
Return to any specific page after successful submission of form.
Example:
return = "smart-members/profile"
error_reporting
Error reporting format is defined by this parameter. It can be either “inline” or “outline”.
“Inline” error reporting will show the error in same page.
“outline” error reporting will show error in EE gray box in new page.
Example:
error_reporting="inline"
wrap_errors
Use this parameter to wrap forms error in any span or div if set error_reporting=”inline”.
Example:
wrap_errors="<span class='error-inline'>|</span>"
on_submit
This parameter allows us to call any Javascript function on submit of form
Example:
on_submit="call_me( )"
secure_action
Secure action will post the data on secure site i.e., https
Example:
secure_action="yes"
secure_return
Secure return will return the page after submit of form on secure site i.e., https
Example:
secure_return="yes"
enable_recaptcha
This parameter enables recaptcha instead of normal captcha.
- Scenario EE2:
- If this parameter is set and API key and SECRET is not passed for recaptcha in backend, The normal captcha will show.
- If recaptcha API key and SECRET is passed in backend and this parameter not set:
- If the page is registration page and you have set captcha as required from member preferences, normal captcha will show.
- If the page is not registration page, neither captcha or recaptcha will show.
- If recaptcha API key and SECRET is passed in backend and this parameter is set:
- If the page is registration page and you have set captcha as required from member preferences, The normal captcha will not show and recaptcha will override the settings.
- If the page is not registration page, recaptcha will show.
- Scenario EE3:
- Same scenario like EE2. Only change is, there is backend member preference settings in EE3 that allows to not enter any captcha if member is logged in. So if you set this parameter and API key and SECRET is also passed, If you are logged in this recaptcha or captcha will not show until you set “Require CAPTCHA while logged in?” to “Yes” from backend member settings > captcha settings.
Example:
enable_recaptcha="yes"
member_id
Use this parameter if you want to edit some other member’s information instead of current logged in member. You can pass member_id of member whose data you want to modify and can modify just like you edit your own profile.
If you want to edit username, email or password, You need to have a field name current_password. You need to enter password of current logged in member in this field.
Example:
member_id="25"
member_id="{segment_3}"
allowed_admin_groups
This parameter play main role if you want to modify member data of other users. You can restrict modifiers by their group. So if you want to have only super admin, site admins and modifiers to edit information of other members, Just pass their group_id in this parameter and they will be able to edit all information for particular member.
For EE6, you will pass the primary role ID to this parameter.
Note: That can be a major risk if you give any random people to change data of other members. It is requested to use this functionality wisely.
Example:
allowed_admin_groups="1"
allowed_admin_groups="1|6|7"
Different methods that can be use by user are given below.
Input
<input type="email" name="username" placeholder="Email Address"> {error:username} //if error_reporting="inline"
Textarea
<textarea name="signature"></textarea> {error:signature} //if error_reporting="inline"
File field
<input type="file" name="avatar_filename" /> {error:avatar_filename} //if error_reporting="inline"
Select Dropdown: (For member group) (For <= EE5)
{data_group_id} {if data_group_id:count == 1} <select name="group_id"> <option value=""></option> {/if} <option value = "{group_id_value}" {if group_id == group_id_value} selected{/if}> {group_id_label}</option> {if data_group_id:count == data_group_id:total_results} </select> {error:group_id} //if error_reporting="inline" {/if} {/data_group_id}
Select Dropdown: (For member primary role) (For EE6)
{data_group_id} {if data_group_id:count == 1} <select name="role_id"> <option value=""></option> {/if} <option value = "{group_id_value}" {if group_id == group_id_value} selected{/if}> {group_id_label}</option> {if data_group_id:count == data_group_id:total_results} </select> {error:role_id} //if error_reporting="inline" {/if} {/data_group_id}
Select Dropdown: (For custom field)
{data_CUSTOM_FIELD} {if data_CUSTOM_FIELD:count == 1} <select name="CUSTOM_FIELD"> <option value=""></option> {/if} <option value = "{CUSTOM_FIELD_value}" {if CUSTOM_FIELD_value == CUSTOM_FIELD}selected{/if}> {CUSTOM_FIELD_label} </option> {if data_CUSTOM_FIELD:count == data_CUSTOM_FIELD:total_results} </select> {error:CUSTOM_FIELD} //if error_reporting="inline" {/if} {/data_CUSTOM_FIELD}
Captcha
{if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"> <label for="recaptcha">Click the checkbox</label>{recaptcha} {error:recaptcha} </p> {/if}
CUSTOM_CHECKBOX_FIELD (Pro Feature)
{data_CUSTOM_CHECKBOX_FIELD} {if data_CUSTOM_CHECKBOX_FIELD:count == 1} <p style="display: inline-flex; "> {/if} <input type="checkbox" name="CUSTOM_CHECKBOX_FIELD[]" value="{CUSTOM_CHECKBOX_FIELD_value}" id="test_{data_CUSTOM_CHECKBOX_FIELD:count}" {if CUSTOM_CHECKBOX_FIELD_value:exists}checked{/if}> <label for="test_{data_CUSTOM_CHECKBOX_FIELD:count}">{CUSTOM_CHECKBOX_FIELD_label}</label> {if data_CUSTOM_CHECKBOX_FIELD:count == data_CUSTOM_CHECKBOX_FIELD:total_results} {error:CUSTOM_CHECKBOX_FIELD} </p> {/if} {/data_CUSTOM_CHECKBOX_FIELD}
CUSTOM_RADIO_FIELD (Pro Feature)
{data_CUSTOM_RADIO_FIELD} {if data_CUSTOM_RADIO_FIELD:count == 1} <p style="display: inline-flex;"> {/if} <input type="radio" name="CUSTOM_RADIO_FIELD" value="{CUSTOM_RADIO_FIELD_value}" id="test_{data_CUSTOM_RADIO_FIELD:count}" {if CUSTOM_RADIO_FIELD_value:exists}checked{/if}> <label for="test_{data_CUSTOM_RADIO_FIELD:count}">{CUSTOM_RADIO_FIELD_label}</label> {if data_CUSTOM_RADIO_FIELD:count == data_CUSTOM_RADIO_FIELD:total_results} {error:CUSTOM_RADIO_FIELD} </p> {/if} {/data_CUSTOM_RADIO_FIELD}
CUSTOM_MULTI_SELECT_FIELD (Pro Feature)
{data_CUSTOM_MULTI_SELECT_FIELD} {if data_CUSTOM_MULTI_SELECT_FIELD:count == 1} <p style="display: inline-flex; "> <select multiple name="CUSTOM_MULTI_SELECT_FIELD[]"> {/if} <option value="{CUSTOM_MULTI_SELECT_FIELD_value}" {if CUSTOM_MULTI_SELECT_FIELD_value:exists}selected{/if}>{CUSTOM_MULTI_SELECT_FIELD_label}</option> {if data_CUSTOM_MULTI_SELECT_FIELD:count == data_CUSTOM_MULTI_SELECT_FIELD:total_results} </select> {error:CUSTOM_MULTI_SELECT_FIELD} </p> {/if} {/data_CUSTOM_MULTI_SELECT_FIELD}
CUSTOM_FILE_FIELD (Pro Feature)
<p> Old file name: {CUSTOM_FILE_FIELD}<br> <input type="file" name="CUSTOM_FILE_FIELD"> {error:CUSTOM_FILE_FIELD} </p>
Example (For <= EE5):
{exp:smart_members:edit allowed_groups="6|7|5" rule:username="required|valid_email|min_length[5]" rule:password="required|matches[password_confirm]|min_length[5]" rule:password_confirm="required|min_length[5]" rule:group_id="required" rule:state="required" rule:first_name="required" attr:id="edit_profile_id" attr:class="edit_profile_class" attr:name="edit_profile-form" attr:data-id="edit_profile_data_id_attr" return="smart-members/edit-profile" enable_recaptcha="yes" error_reporting="inline" wrap_errors="<span class='error-inline'>|</span>" on_submit="edit_profile()" } <p> <input type="text" name="CUSTOM_FIELD" placeholder="CUSTOM FIELD"> {error:CUSTOM_FIELD} </p> {data_group_id} {if data_group_id:count == 1} <p> <select name="group_id"> <option value=""></option> {/if} <option value="{group_id_value}" {if group_id_value == group_id} selected{/if}> {group_id_label} </option> {if data_group_id:count == data_group_id:total_results} </select> {error:group_id} </p> {/if} {/data_group_id} <p> <input type="text" name="username" value="{username}"> {error:username} </p> <p> <input type="text" name="email" value="{email}"> {error:email} </p> <p> <input type="password" name="current_password"> {error:current_password} </p> <p> <input type="password" name="password"> {error:password} </p> <p> <input type="password" name="password_confirm"> {error:password_confirm} </p> <p> {if avatar_filename} <img src="{avatar_url}{avatar_filename}" height="100" width="100">{/if} <input type="file" name="avatar_filename" /> {error:avatar_filename} </p> {if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"><label for="recaptcha">Click the checkbox</label> {recaptcha} {error:recaptcha} </p> {/if} <div class="edit-profile-click cf"> <input type="submit" class="edit" value="Update Profile"> </div> {/exp:smart_members:edit}
Example (For EE6):
{exp:smart_members:edit allowed_groups="6|7|5" rule:username="required|valid_email|min_length[5]" rule:password="required|matches[password_confirm]|min_length[5]" rule:password_confirm="required|min_length[5]" rule:role_id="required" rule:state="required" rule:first_name="required" attr:id="edit_profile_id" attr:class="edit_profile_class" attr:name="edit_profile-form" attr:data-id="edit_profile_data_id_attr" return="smart-members/edit-profile" enable_recaptcha="yes" error_reporting="inline" wrap_errors="<span class='error-inline'>|</span>" on_submit="edit_profile()" } <p> <input type="text" name="CUSTOM_FIELD" placeholder="CUSTOM FIELD"> {error:CUSTOM_FIELD} </p> {data_group_id} {if data_group_id:count == 1} <p> <select name="role_id"> <option value=""></option> {/if} <option value="{group_id_value}" {if group_id_value == group_id} selected{/if}> {group_id_label} </option> {if data_group_id:count == data_group_id:total_results} </select> {error:role_id} </p> {/if} {/data_group_id} <p> <input type="text" name="username" value="{username}"> {error:username} </p> <p> <input type="text" name="email" value="{email}"> {error:email} </p> <p> <input type="password" name="current_password"> {error:current_password} </p> <p> <input type="password" name="password"> {error:password} </p> <p> <input type="password" name="password_confirm"> {error:password_confirm} </p> <p> {if avatar_filename} <img src="{avatar_url}{avatar_filename}" height="100" width="100">{/if} <input type="file" name="avatar_filename" /> {error:avatar_filename} </p> {if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"><label for="recaptcha">Click the checkbox</label> {recaptcha} {error:recaptcha} </p> {/if} <div class="edit-profile-click cf"> <input type="submit" class="edit" value="Update Profile"> </div> {/exp:smart_members:edit}
Remove Image
Member can remove their images from “Edit member form”. This section contains removing of default images i.e., “Avatar file, Photo fIle and Signature image file”.
You can remove these images in 2 way.
Parameters
By submit the form
You need to pass an submit button named the file.
Examples:To remove Avatar file pass this “name” attribute in submit button: (You can pass anything in “value” according to your form.)
<input type="submit" name="remove_avatar" value="Remove Avatar" > <input type="submit" name="remove_avatar" value="Submit" > <input type="submit" name="remove_avatar" value="Edit Profile" >
To remove Photo file pass this “name” attribute in submit button: (You can pass anything in “value” according to your form.)
<input type="submit" name="remove_photo" value="Remove Photo" > <input type="submit" name="remove_photo" value="Submit" > <input type="submit" name="remove_photo" value="Edit Profile" >
To remove Signature file pass this “name” attribute in submit button: (You can pass anything in “value” according to your form.)
<input type="submit" name="remove_sig_img" value="Remove Signature"> <input type="submit" name="remove_sig_img" value="Submit" > <input type="submit" name="remove_sig_img" value="Edit Profile" >
When you submit the form with this input type, it will remove the file when you submit the form (Only file entry will remove, Images will still there in image upload folder till user not upload another image.)
By input field
You can also pass a hidden value or radio button or javascript named with attribute remove name to remove that image.
Examples:
<input type='hidden' name='remove_avatar'> <input type='hidden' name='remove_photo'> <input type='hidden' name='remove_sig_img'>
or
<input type="radio" name="remove_avatar" value="remove"/> Remove Avatar? <input type="radio" name="remove_photo" value="remove"/> Remove Photo? <input type="radio" name="remove_sig_img" value="remove"/> Remove Signature?
Below is the example of JQuery remove:
Example:
{exp:smart_members:edit return="smart-members/edit-profile" password_required="no" error_reporting="inline" wrap_errors="<span class='error-inline'>|</span>" } <p> {if avatar_filename} <div> <img src="{avatar_url}{avatar_filename}" height="100" width="100"> <a href="javascript:void(0);" class="remove_sm_pic" add_field_attr="remove_avatar"> Remove Avatar </a><br> </div> {/if} <input type="file" name="avatar_filename" /> {error:avatar_filename} </p> <p> {if photo_filename} <div> <img src="{photo_url}{photo_filename}" height="100" width="100"> <a href="javascript:void(0);" class="remove_sm_pic" add_field_attr="remove_photo"> Remove Photo </a><br> </div> {/if} <input type="file" name="photo_filename" /> {error:photo_filename} </p> <p> {if sig_img_filename} <div> <img src="{sig_img_url}{sig_img_filename}" height="100" width="100"> <a href="javascript:void(0);" class="remove_sm_pic" add_field_attr="remove_sig_img"> Remove Signature </a><br> </div> {/if} <input type="file" name="sig_img_filename" /> {error:sig_img_filename} </p> <div class="login-edit-click cf"> <input type="submit" value="Update Account Information" > </div> {/exp:smart_members:edit}
JQuery:
<script type="text/javascript"> $(document).ready(function() { $(document).on('click', '.remove_sm_pic', function(event) { event.preventDefault(); /* Act on the event */ if(typeof($(this).attr('add_field_attr')) !== "undefined") { if($(this).parent('div').find("input[name="+ $(this).attr('add_field_attr') +"]").length == 0) { $(this).parent('div').hide() $(this).parent('div').append("<input type='hidden' name='"+ $(this).attr('add_field_attr') +"'>") } } else { console.log('Cannnot remove') } }); }); </script>
View Profile
View profile module is to list the member(s) data. You can access each and every data except password with this module.
Tag for View profile module will look like this.
{exp:smart_members:profile} Content data {/exp:smart_members:profile}
Parameters
Fields
- aol_im
- avatar_url
- avatar_filename
- avatar_height
- avatar_width
- bday_d
- bday_m
- bday_y
- bio
- group_id (For <= EE5)
- role_id (For EE6)
- icq
- interests
- join_date
- last_activity
- last_bulletin_date
- last_comment_date
- last_entry_date
- last_email_date
- last_forum_post_date
- last_view_bulletins
- last_visit
- location
- member_id
- msn_im
- notepad
- notepad_size
- occupation
- private_messages
- photo_url
- photo_filename
- photo_height
- photo_width
- screen_name
- signature
- sig_img_url
- sig_img_filename
- sig_img_width
- sig_img_height
- total_comments
- total_entries
- total_forum_topics
- total_forum_posts
- username
- url
- yahoo_im
- CUSTOM_FIELD
Labels
- aol_im_label
- avatar_filename_label
- avatar_height_label
- avatar_width_label
- bday_d_label
- bday_m_label
- bday_y_label
- bio_label
- email_label
- group_id_label (For <= EE5)
- role_id_label (For EE6)
- icq_label
- interests_label
- join_date_label
- last_activity_label
- last_bulletin_date_label
- last_comment_date_label
- last_entry_date_label
- last_email_date_label
- last_forum_post_date_label
- last_view_bulletins_label
- last_visit_label
- location_label
- member_id_label
- msn_im_label
- notepad_label
- notepad_size_label
- occupation_label
- private_messages_label
- photo_filename_label
- photo_height_label
- photo_width_label
- screen_name_label
- signature_label
- sig_img_filename_label
- sig_img_width_label
- sig_img_height_label
- total_comments_label
- total_entries_label
- total_forum_topics_label
- total_forum_posts_label
- username_label
- url_label
- yahoo_im_label
- CUSTOM_FIELD_label
To list all the fields above there is single field. It will list all the static fields which is not empty as well as all the custom fields created by user.
- sm_list_all_fields
- Parameters (It doesn’t contain any parameter)
- Fields
- field_label
- field_value
- field_sort_name
- field_db_name
- sm_list_all_fields:count
- sm_list_all_fields:total_results
Example:
{sm_list_all_fields} {field_label} : {field_value} {/sm_list_all_fields}
Following Parameters can be use in View Profile page
member_id
Member ID of user you want to get the data of.
Not to use this parameter, Leave this parameter blank or pass “CURRENT_MEMBER” in parameter will extract profile data of current member.
Pass “ALL_MEMBERS” in parameter if you want to fetch all the members.
Example:
member_id = "" member_id = "CURRENT_MEMBER" member_id = "ALL_MEMBERS" member_id = "53" member_id = "50|51|52|53"
group_id
Member(s) of particular group you want to get data of.
Using this parameter will filter the output data with member group. If member group doesn’t exists in the groups passed in parameter, it will not show the data of member.
Passing nothing in this parameter will bring every groups except “banned (2)”, “Guests (3)” and “Pending (4)”.
For EE6, you can use this same parameter to pass the member primary role ID. You can also use the ‘role_id’ parameter instead of the ‘group_id’ parameter if you want it for the EE6.
Example:
group_id = "5" group_id = "5|6|7"
not_member_id
You can pass the ID of the member(s) with pipe ( | ) separated to ignore record of that member.
For EE6, you will pass the primary role ID to this parameter.
Example:
not_member_id = "2" not_member_id = "2|4"
not_group_id
You can pass the ID of the group with pipe ( | ) separated to ignore record of that group.
For EE6, you will pass the primary role ID to this parameter.
Example:
not_group_id = "5" not_group_id = "5|6"
limit
You can Limit output rows by any value you want.
Example:
limit = "50"
order_by
This parameter use to start sorting via any proper field. You can use both default member field or custom member field to group by the result.
Example:
order_by = "member_id" order_by = "first_name"
sort
You can sort the output by ASC or DESC.
Example:
sort = "asc" sort = "desc"
How to render custome member fields
We have developed custem member field types like checkbox, dropdown, radio button, file, etc
user can render this custom member fields with some tags like below
If user want to render checkbox and multi-select dropdown then use below code.
Example:
{CUSTM_MEMBER_FIELD_SHORT_NAME} {CUSTM_MEMBER_FIELD_SHORT_NAME:label} : {CUSTM_MEMBER_FIELD_SHORT_NAME:value} {CUSTM_MEMBER_FIELD_SHORT_NAME}
If user want to render other then checkbox and multi-select dropdown ( means single value custom field ) then use below code.
Example:
{CUSTM_MEMBER_FIELD_SHORT_NAME}
OR
{CUSTM_MEMBER_FIELD_SHORT_NAME:label} : {CUSTM_MEMBER_FIELD_SHORT_NAME:value}
Example (For <= EE5):
{exp:smart_members:profile member_id="ALL_MEMBERS" not_group_id="1|6" not_member_id="14|1" } {if no_results} <p>no data found!!</p> {/if} <p>Your details of member id {member_id} are as follows:</p> <p>All Fields:</p> <ul> {sm_list_all_fields} <li><b>{field_label} : </b> {field_value}</li> {/sm_list_all_fields} </ul> <p>Fields of interest:</p> <ul> <li> <b> {group_id_label} : </b> {group_id} </li> <li> <b> {username_label} : </b> {username} </li> <li> <b> {screen_name_label} : </b> {screen_name}</li> <li> <b> {email_label} : </b> {email} </li> </ul> {/exp:smart_members:profile}
Example (For EE6):
{exp:smart_members:profile member_id="ALL_MEMBERS" not_group_id="1|6" not_member_id="14|1" } {if no_results} <p>no data found!!</p> {/if} <p>Your details of member id {member_id} are as follows:</p> <p>All Fields:</p> <ul> {sm_list_all_fields} <li><b>{field_label} : </b> {field_value}</li> {/sm_list_all_fields} </ul> <p>Fields of interest:</p> <ul> <li> <b> {role_id_label} : </b> {role_id} </li> <li> <b> {username_label} : </b> {username} </li> <li> <b> {screen_name_label} : </b> {screen_name}</li> <li> <b> {email_label} : </b> {email} </li> </ul> {/exp:smart_members:profile}
Forgot Password
Forgot Password module is use to send URL of reset password with key to reset the password of user.
Parameter of reset password template as well as forgot password email settings can be sent from backend smart members setting or can pass in this tag as parameter.
Tag for View profile module will look like this.
{exp:smart_members:forgot_password} ... Content data ... {/exp:smart_members:forgot_password}
Parameters
- rule:FIELD_NAME
- attr:ATTRIBUTES
- return
- error_reporting
- wrap_errors
- on_submit
- secure_action
- secure_return
- reset_password_template
- email:subject
- email:template
- email:word_wrap
- email:mailtype
- enable_recaptcha
Fields
- captcha
Following Parameters can be use in Forgot Password form
rule:FIELD_NAME
Rule parameter is use to give custom rules to fields separate by pipe ( | ).
Example:
rule:username = "required" rule:email = "required|valid_email|is_unique[members.email]"
attr:ATTRIBUTES
Parameter to add attributes in form. We can add classes, ids etc.
Example:
attr:id = "form_id" attr:class = "form_class" attr:name = "form_name" attr:data-id = "form_data_id"
return
Return to any specific page after successful submission of form.
Example:
return = "smart-members/profile"
error_reporting
Error reporting format is defined by this parameter. It can be either “inline” or “outline”.
“Inline” error reporting will show the error in same page.
“outline” error reporting will show error in EE gray box in new page.
Example:
error_reporting="inline"
wrap_errors
Use this parameter to wrap forms error in any span or div if set error_reporting=”inline”.
If error_reporting is set to inline and not defined this parameter, It will take span to display errors.
Example:
wrap_errors="<span class='error-inline'>|</span>"
on_submit
This parameter allows us to call any Javascript function on submit of form.
Example:
on_submit="call_me( )
secure_action
Secure action will post the data on secure site i.e., https.
Example:
secure_action="yes"
secure_return
Secure return will return the page after submit of form on secure site i.e., https.
Example:
secure_return="yes"
reset_password_template
Pass template path of reset password page. URL of this page will pass in forgot password email with reset token to user.
(Note: This can be passed from template as parameter or can set from backend member settings. If passed from backend don’t pass this parameter.)
Example:
reset_password_template="smart-members/reset-password"
email:subject
Pass forgot password email subject in this parameter. Pass the value in this parameter will show as a subject of email.
(Note: This can be passed from template as parameter or can set from backend member settings. If passed from backend don’t pass this parameter.)
Example:
email:subject = "Reset password request | {site_name}"
email:template
Pass forgot password email template path in this parameter. Template passed in this parameter will send as forgot password email body to member.
(Note: This can be passed from template as parameter or can set from backend member settings. If passed from backend don’t pass this parameter.)
Example:
email:template = "smart-members/email-forgot-password"
email:word_wrap
Pass the word wrap settings in this parameter.
(Note: This can be passed from template as parameter or can set from backend member settings. If passed from backend don’t pass this parameter.)
Example:
email:word_wrap = "yes"
email:mailtype
Pass email type in this parameter. Choosing right parameter is very important. If we choose “html”, the normal text will execute in same line and it will not look proper in email. Same as if we choose “text” as parameter, It will not consider HTML tags such as <p> <b> etc. and the tags will appear in mail body.
(Note: This can be passed from template as parameter or can set from backend member settings. If passed from backend don’t pass this parameter.)
Example:
email:mailtype = "text" email:mailtype = "html"
enable_recaptcha
This parameter enables recaptcha instead of normal captcha.
- Scenario EE2:
- If this parameter is set and API key and SECRET is not passed for recaptcha in backend, The normal captcha will show.
- If recaptcha API key and SECRET is passed in backend and this parameter not set:
- If the page is registration page and you have set captcha as required from member preferences, normal captcha will show.
- If the page is not registration page, neither captcha or recaptcha will show.
- If recaptcha API key and SECRET is passed in backend and this parameter is set:
- If the page is registration page and you have set captcha as required from member preferences, The normal captcha will not show and recaptcha will override the settings.
- If the page is not registration page, recaptcha will show.
- Scenario EE3:
- Same scenario like EE2. Only change is, there is backend member preference settings in EE3 that allows to not enter any captcha if member is logged in. So if you set this parameter and API key and SECRET is also passed, If you are logged in this recaptcha or captcha will not show until you set “Require CAPTCHA while logged in?” to “Yes” from backend member settings > captcha settings.
Example:
enable_recaptcha="yes"
Different methods that can be use by user are given below.
Input
<input type="email" name="username" placeholder="Email Address"> {error:username} //if error_reporting="inline"
Captcha
{if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"> <label for="recaptcha">Click the checkbox</label>{recaptcha} {error:recaptcha} </p> {/if}
Example:
{exp:smart_members:forgot_password attr:id="fp_id" attr:class="fp_class" attr:name="fp-form" attr:data-id="fp_data_id_attr" return="smart-members/send-forg-mail" error_reporting="inline" wrap_errors="<span class='error-inline'>|</span>" on_submit="fp()" enable_recaptcha="yes" reset_password_template="smart-members/reset-password" email:subject="Reset password request" email:template="smart-members/forgot-password-email-template" email:word_wrap="yes" email:mailtype="html" } <p> <input type="email" name="email"> {error:email} </p> {if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"> <label for="recaptcha">Click the checkbox</label> {recaptcha} {error:recaptcha} </p> {/if} <p> <input type="submit" class="forgot-pass" value="Send email" > </p> {/exp:smart_members:forgot_password}
Reset Password
Reset Password module is use to set new password with help of token send by user in mail through forgot password email.
Tag for Reset password module will look like this.
{exp:smart_members:reset_password} ... Content data ... {/exp:smart_members:reset_password}
Parameters
- rule:FIELD_NAME
- attr:ATTRIBUTES
- return
- error_reporting
- wrap_errors
- on_submit
- secure_action
- secure_return
- enable_recaptcha
- reset_code
Fields
- password
- password_confirm
- captcha
Following Parameters can be use in Forgot Password form
rule:FIELD_NAME
Rule parameter is use to give custom rules to fields separate by pipe ( | ).
Example:
rule:username = "required" rule:email = "required|valid_email|is_unique[members.email]"
attr:ATTRIBUTES
Parameter to add attributes in form. We can add classes, ids etc.
Example:
attr:id = "form_id" attr:class = "form_class" attr:name = "form_name" attr:data-id = "form_data_id"
return
Return to any specific page after successful submission of form.
Example:
return = "smart-members/profile"
error_reporting
Error reporting format is defined by this parameter. It can be either “inline” or “outline”.
“Inline” error reporting will show the error in same page.
“outline” error reporting will show error in EE gray box in new page.
Example:
error_reporting="inline"
wrap_errors
Use this parameter to wrap forms error in any span or div if set error_reporting=”inline”.
If error_reporting is set to inline and not defined this parameter, It will take span to display errors.
Example:
wrap_errors="<span class='error-inline'>|</span>"
on_submit
This parameter allows us to call any Javascript function on submit of form.
Example:
on_submit="call_me( )
secure_action
Secure action will post the data on secure site i.e., https.
Example:
secure_action="yes"
secure_return
Secure return will return the page after submit of form on secure site i.e., https.
Example:
secure_return="yes"
enable_recaptcha
This parameter enables recaptcha instead of normal captcha.
- Scenario EE2:
- If this parameter is set and API key and SECRET is not passed for recaptcha in backend, The normal captcha will show.
- If recaptcha API key and SECRET is passed in backend and this parameter not set:
- If the page is registration page and you have set captcha as required from member preferences, normal captcha will show.
- If the page is not registration page, neither captcha or recaptcha will show.
- If recaptcha API key and SECRET is passed in backend and this parameter is set:
- If the page is registration page and you have set captcha as required from member preferences, The normal captcha will not show and recaptcha will override the settings.
- If the page is not registration page, recaptcha will show.
- Scenario EE3:
- Same scenario like EE2. Only change is, there is backend member preference settings in EE3 that allows to not enter any captcha if member is logged in. So if you set this parameter and API key and SECRET is also passed, If you are logged in this recaptcha or captcha will not show until you set “Require CAPTCHA while logged in?” to “Yes” from backend member settings > captcha settings.
Example:
enable_recaptcha="yes"
reset_code
Reset code is the token sent in forgot password email to user. You can simply set it parameterize from URL segment.
Example:
reset_code = "{segment_3}"
Different methods that can be use by user are given below.
Input
<input type="email" name="password" placeholder="Password"<
{error:password} //if error_reporting="inline"
Captcha
{if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"> <label for="recaptcha">Click the checkbox</label>{recaptcha} {error:recaptcha} </p> {/if}
Example:
{if segment_3 != "reset-success"} {exp:smart_members:reset_password reset_code="{segment_3}" rule:password="required|matches[password_confirm]|min_length[5]" rule:password_confirm="required|min_length[5]" attr:id="rp_id" attr:class="rp_class" attr:name="rp-form" attr:data-id="rp_data_id_attr" return="smart-members/reset-password/reset-success" enable_recaptcha="yes" error_reporting="inline" wrap_errors="<span class='error-inline'>|</span>" on_submit="rp()" } {if no_results}<h4>The reset token provided is invalid.</h4> {/if} <p> <input type="password" name="password">{error:password} </p> <p> <input type="password" name="password_confirm">{error:password_confirm} </p> {if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"> <label for="recaptcha">Click the checkbox</label> {recaptcha} {error:recaptcha} </p> {/if} <p> <input type="submit" class="reset" value="Reset password" > </p> {/exp:smart_members:reset_password} {if:else} <p> Password successfully updated. You can now <a href="/smart-members/login"> login</a> with new credentials.</p> {/if}
Delete Member
Delete member module is use to allow member to delete himself from membership account of site. If one will delete his/her account, all the entries or data he/she has entered in the site will also deletes.
Any one can delete his/her account from site except super admin.
To delete the member user only needs his/her account password.
Tag for Delete member module will look like this.
{exp:smart_members:delete} ... Content data ... {/exp:smart_members:delete}
Parameters
- rule:FIELD_NAME
- attr:ATTRIBUTES
- return
- error_reporting
- wrap_errors
- on_submit
- secure_action
- secure_return
- enable_recaptcha
Fields
- password
- captcha
Following Parameters can be use in Forgot Password form
rule:FIELD_NAME
Rule parameter is use to give custom rules to fields separate by pipe ( | ).
Example:
rule:username = "required" rule:email = "required|valid_email|is_unique[members.email]"
attr:ATTRIBUTES
Parameter to add attributes in form. We can add classes, ids etc.
Example:
attr:id = "form_id" attr:class = "form_class" attr:name = "form_name" attr:data-id = "form_data_id"
return
Return to any specific page after successful submission of form.
Example:
return = "smart-members/profile"
error_reporting
Error reporting format is defined by this parameter. It can be either “inline” or “outline”.
“Inline” error reporting will show the error in same page.
“outline” error reporting will show error in EE gray box in new page.
Example:
error_reporting="inline"
wrap_errors
Use this parameter to wrap forms error in any span or div if set error_reporting=”inline”.
If error_reporting is set to inline and not defined this parameter, It will take span to display errors.
Example:
wrap_errors="<span class='error-inline'>|</span>"
on_submit
This parameter allows us to call any Javascript function on submit of form.
Example:
on_submit="call_me( )
secure_action
Secure action will post the data on secure site i.e., https.
Example:
secure_action="yes"
secure_return
Secure return will return the page after submit of form on secure site i.e., https.
Example:
secure_return="yes"
enable_recaptcha
This parameter enables recaptcha instead of normal captcha.
- Scenario EE2:
- If this parameter is set and API key and SECRET is not passed for recaptcha in backend, The normal captcha will show.
- If recaptcha API key and SECRET is passed in backend and this parameter not set:
- If the page is registration page and you have set captcha as required from member preferences, normal captcha will show.
- If the page is not registration page, neither captcha or recaptcha will show.
- If recaptcha API key and SECRET is passed in backend and this parameter is set:
- If the page is registration page and you have set captcha as required from member preferences, The normal captcha will not show and recaptcha will override the settings.
- If the page is not registration page, recaptcha will show.
- Scenario EE3:
- Same scenario like EE2. Only change is, there is backend member preference settings in EE3 that allows to not enter any captcha if member is logged in. So if you set this parameter and API key and SECRET is also passed, If you are logged in this recaptcha or captcha will not show until you set “Require CAPTCHA while logged in?” to “Yes” from backend member settings > captcha settings.
Example:
enable_recaptcha="yes"
Different methods that can be use by user are given below.
Input
<input type="password" name="password" placeholder="Password"> {error:password} //if error_reporting="inline"
Captcha
{if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"> <label for="recaptcha">Click the checkbox</label>{recaptcha} {error:recaptcha} </p> {/if}
Example:
{exp:smart_members:delete attr:id="dm_id" attr:class="dm_class" attr:name="dm-form" attr:data-id="dm_data_id_attr" return="smart-members/index" error_reporting="inline" wrap_errors="<span class='error-inline'>|</span>" on_submit="dm()" enable_recaptcha="yes" } <p> <input type="password" name="password" placeholder="Password"> {error:password} </p> {if captcha} <p> <label for="captcha">Please enter in the word you see:</label> {captcha} <input type="text" name="captcha" id="captcha" /> {error:captcha} </p> {if:elseif recaptcha} <p style="margin: 0;"> <label for="recaptcha">Click the checkbox</label> {recaptcha} {error:recaptcha} </p> {/if} <p> <input type="submit" class="delete" value="Delete Account" > </p> {/exp:smart_members:delete}
Logout
Logout module provides a user to successfully destroy the session and logging out from the site.
Tag for logout created in 2 ways. One is with closing tag and another one is without closing tag.
With closing tag, content code will look something like this:
{exp:smart_members:logout return='smart-members/index'} <p> <a href="{url}">Logout</a> </p> {/exp:smart_members:logout}
Without closing tag, content code will look like this:
<a href="{exp:smart_members:logout return='smart-members/index'}">Logout</a>
Parameters
Following Parameters can be use in Forgot Password form
return
Return to any specific page after successful submission of form.
Example:
return = "smart-members/profile"
secure_return
Secure return will return the page after submit of form on secure site i.e., https.
Example:
secure_return="yes"
Changelog
V2.0.0
- Initial Version
V3.0.0
- Updated the license verification process and setup so please update the license in your addon.
V4.0.0
- EE6 Compatibility.
- Change ‘group_id’ to ‘role_id’ in select field in register template.
- Change ‘error:group_id’ to ‘error:role_id’ in register template.
- Change ‘rule:group_id=”required”” to ‘rule:role_id=”required”‘ in register template.
- Change parameter ‘group_id’ to ‘role_id’ in the register template.
- Change ‘group_id’ to ‘role_id’ in select field in edit profile template.
- Change ‘error:group_id’ to ‘error:role_id’ in edit profile template.
- Change ‘rule:group_id=”required”” to ‘rule:role_id=”required”‘ in edit profile template.
- Change ‘{group_id_label}’ to “{role_id_label}” in the view profile template.
- Change ‘{group_id}’ to ‘{role_id}’ in the view profile template.
V4.0.1
- Solved issue of the duplicate member in social login for the twitter
V4.0.2
- Solved issue of email not getting in Twitter social login and some warning related errors.
V4.0.3
- Solved the warning of the Unparenthesized in the ternary operator.
V4.0.4
- Solved issue while updating ExpressionEngine from EE5.0.3 to 5.x
V4.0.5
- Added the feature of exporting the multiple member roles for EE6.
V4.0.6
- Provided access to the “Forgot Password” and “Reset Password” forms during the login session to solve the problem of update password for the social login.