This is useful if we want our member to provide some info when they create a thread in a specified forum.
In this simple example, we will set a forum so when a member create a new thread in that forum, they need to fill a field with their Website URL, which is required, and optionally, they can fill a field with they Forum URL, which is not required.
Here is the simple setting for our XThreads:
1. XThreads Options in Forum settings:
- Template Prefix: intro_
- Show first post on every showthread page: Yes
2. Create a Custom Thread Fields with this settings:
- Title: Your Website URL
- Key: wwwurl
- Description: Fill the field with your full site URL (required).
- Applicable Forums: 'select a forum that we want the fields to be applied'
- Input Field Type: Textbox
- Editable by / Required Field?: Everyone (Required)
- Display Format:
3. Create another Custom Thread Fields with this settings:
- Title: Your Forum URL
- Key: forumurl
- Description: Fill the field with your full forum url (not required).
- Applicable Forums: 'select the same as the forum in point 2'
- Input Field Type: Textbox
- Editable by / Required Field?: Everyone
- Display Order: 2
- Blank Replacement Value:
- Display Format:
4. Create a new template in Global Template:
- Template Name: intro_postbit_first
- Template Content:
The template above based on the default postbit template. If we have a custom postbit template, copy paste the template content into intro_postbit_first template. Then add {$GLOBALS['threadfields']['wwwurl']} and {$GLOBALS['threadfields']['forumurl']} variables into the template.
- Template Name: intro_postbit_first_classic
- Template Content:
Again, the template above based on the default postbit_classic template. If we have a custom postbit_classic template, copy paste the template content into intro_postbit_first_classic template. Then add {$GLOBALS['threadfields']['wwwurl']} and {$GLOBALS['threadfields']['forumurl']} variables into the template.
Please remember that the key for this is, adding {$GLOBALS['threadfields']['wwwurl']} and {$GLOBALS['threadfields']['forumurl']} variables into the intro_postbit_first and/or intro_postbit_first_classic template.
Screenshots:
1. A member create a new thread in a specified forum:
2. Result (Horizontal postbit layout):
3. Result (Classic postbit layout):
4. Error message will be displayed when they didn't fill the "Website URL" field (required field):