m (Minor content and grammatical enhancements) |
(removed HTML) |
||
Line 27: | Line 27: | ||
###Next, if you are using the SMF default theme, Curve 2, or if you want to use the same icon across all your themes, you can keep "DEFAULT_IMAGES_URL" just as it is. Then you either need to select an icon from ...Themes/default/images, or if you found an icon somewhere else, upload it there. This will save you some time and energy.<!-- | ###Next, if you are using the SMF default theme, Curve 2, or if you want to use the same icon across all your themes, you can keep "DEFAULT_IMAGES_URL" just as it is. Then you either need to select an icon from ...Themes/default/images, or if you found an icon somewhere else, upload it there. This will save you some time and energy.<!-- | ||
-- | -->If you want to use a different icon for each custom theme, you need to replace "DEFAULT_IMAGES_URL" with "IMAGES_URL". You then either select an icon from ...Themes/yourtheme/images or, if you found an icon somewhere else, upload it there for each custom theme that you use. | ||
###Next, change "icon.gif" to whatever is your icon's name. | ###Next, change "icon.gif" to whatever is your icon's name. | ||
#In the ''Input Settings'' section, fill in all the fields. | #In the ''Input Settings'' section, fill in all the fields. | ||
Line 34: | Line 34: | ||
##For ''Input Mask'': For most uses, choose ''No HTML''; if the icon is for an email address, choose ''Valid Email''; if the text part will be all numbers, such as for a phone number, select ''Numeric''; and finally, if you know what it means, or want to learn what it means, choose ''Regex (Advanced)''. The question mark icon will help you decide what to enter in the new field which shows up when you make the Regex selection.<!-- | ##For ''Input Mask'': For most uses, choose ''No HTML''; if the icon is for an email address, choose ''Valid Email''; if the text part will be all numbers, such as for a phone number, select ''Numeric''; and finally, if you know what it means, or want to learn what it means, choose ''Regex (Advanced)''. The question mark icon will help you decide what to enter in the new field which shows up when you make the Regex selection.<!-- | ||
-- | -->For the example on this page, about using an icon for a Custom Profile Field, if you are not going to use the Regex option, choose ''No HTML''. | ||
Now you should see your new custom profile field in the Custom Profile Fields table. You should also be able to see the custom profile field in your members' profile forms. | Now you should see your new custom profile field in the Custom Profile Fields table. You should also be able to see the custom profile field in your members' profile forms. |
Revision as of 20:35, 3 September 2024
Please see https://wiki.simplemachines.org/smf/How_to_use_Advanced_Profile_Fields for the first version of this page, which was written for version 2.0.
How to Create Custom or Advanced Profile Fields
Please see Features and Options > Profile Fields to learn how to enable this feature and read descriptions for all the options. At the bottom of the page, Admin Center > Configuration > Features and Options > Profile Fields, is a table titled Custom Profile Fields. The far right column contains a text link, Modify, for each custom profile field in the table. By clicking that, administrators can examine the settings used for each type of custom profile field in the table. By comparing those settings with all the descriptions on the above manual page, you can learn how to make your own custom profile fields.
This wiki page provides more of a step-by-step process, using the same variables as the example on the above manual page. For a more detailed overview, please refer to the page that is linked above.
To get started with either a textual field, or an icon field, go to the table at the bottom of the page, Admin Center > Configuration > Features and Options > Profile Fields. At the bottom, right corner of the table, click the New Field button.
Create Custom Profile Fields as Text
- In the Display Settings section, fill in all the options, except Show Enclosed Within Text.
- In the Input Settings section, whatever option you choose for Field Type, determines the type and number of options in the rest of the form. Most of them are self-explanatory, but you can find descriptions for them on the page referenced above. Most importantly, if you choose the Text option, it will cause the Input Mask option to be displayed in the Advanced Settings section below.
- In the Advanced Settings section, fill in all the options, except Input Mask. Note that Input Mask will not be showing, if you did not choose Text for the Input Settings > Field Type option.
When you have finished, click the Save button in the bottom, right corner. You should see your new custom profile field in the Custom Profile Fields table. There you can further adjust where you want it to appear in the profile. You should also be able to see the new field being used in member profiles.
Create Custom Profile Fields as an Icon
This is the optional and advanced feature, for which an input mask is used to display an icon.
- In the Display Settings section, fill in all the fields.
- For Choose Placement choose an appropriate placement for the icon. The section of the same name, in the Profile Fields section of the manual, describes where the icon will appear in the profile, for each option.
- For this example, in the Show Enclosed Within Text option, paste the same example which was given on the above linked page:
- <a href="http://website.com/{INPUT}"><img src="{DEFAULT_IMAGES_URL}/icon.gif" alt="{INPUT}" /></a>
- Now you need to replace "https://website.com/{INPUT}" with whatever is appropriate for your needs. For example, if it is going to be an icon to call up Skype, then change it to "http://skype.com/{INPUT}".
- Next, if you are using the SMF default theme, Curve 2, or if you want to use the same icon across all your themes, you can keep "DEFAULT_IMAGES_URL" just as it is. Then you either need to select an icon from ...Themes/default/images, or if you found an icon somewhere else, upload it there. This will save you some time and energy.If you want to use a different icon for each custom theme, you need to replace "DEFAULT_IMAGES_URL" with "IMAGES_URL". You then either select an icon from ...Themes/yourtheme/images or, if you found an icon somewhere else, upload it there for each custom theme that you use.
- Next, change "icon.gif" to whatever is your icon's name.
- In the Input Settings section, fill in all the fields.
- You must choose Text for the Field Type field.
- Fill in all the fields in the Advanced Settings section.
- For Input Mask: For most uses, choose No HTML; if the icon is for an email address, choose Valid Email; if the text part will be all numbers, such as for a phone number, select Numeric; and finally, if you know what it means, or want to learn what it means, choose Regex (Advanced). The question mark icon will help you decide what to enter in the new field which shows up when you make the Regex selection.For the example on this page, about using an icon for a Custom Profile Field, if you are not going to use the Regex option, choose No HTML.
Now you should see your new custom profile field in the Custom Profile Fields table. You should also be able to see the custom profile field in your members' profile forms.