- Compatible XF 1.x versions
- 1.2
- 1.3
- 1.4
- 1.5
- Additional requirements
- This add-on requires CTA Featured Threads.
http://xenforo.com/community/resources/cta-featured-threads.2599/
This add-on is not affiliated with XenForo Ltd.
This guide will explain how to create custom user fields which will enable your users to remove the featured thread blocks from the forum list, forum view and new/recent posts pages.
Once completed they will have three additional check boxes on their account/preferences page, like so:
The attached file is for the automatic template modifications only.
The custom user fields must still be created manually as they cannot be attached to add-ons.
Custom User Fields
The first step is to create the custom user fields.
Rather than type it all out, I have attached screen shots which show what must be entered for each one.
You can edit the text to suit but you must keep the Field ID exactly as shown.
Failure to do so will render the check boxes inoperative.
Forum List
Forum View
New / Recent Posts
Templates
The next step is to edit the templates.
There are three ways of doing so, which are explained below:
Simply download and unzip the attached file and then install it like a regular add-on.
2. Manually editing the templates
The three templates you need to edit are:
cta_featuredthreads_forum_list
cta_featuredthreads_forum_view
cta_featuredthreads_find_new_wrapper
3. Creating template modifications
In order to do this you must have debug mode enabled.
Once that is done, you must create three separate template modifications.
The find code for each one is the current template contents.
The replace code for each one is the current template contents wrapped in the corresponding custom user field conditional statement, as above.
This guide will explain how to create custom user fields which will enable your users to remove the featured thread blocks from the forum list, forum view and new/recent posts pages.
Once completed they will have three additional check boxes on their account/preferences page, like so:
The attached file is for the automatic template modifications only.
The custom user fields must still be created manually as they cannot be attached to add-ons.
Custom User Fields
The first step is to create the custom user fields.
Rather than type it all out, I have attached screen shots which show what must be entered for each one.
You can edit the text to suit but you must keep the Field ID exactly as shown.
Failure to do so will render the check boxes inoperative.
Forum List
Forum View
New / Recent Posts
Templates
The next step is to edit the templates.
There are three ways of doing so, which are explained below:
- Installing the attached add-on
- Manually editing the templates
- Creating template modifications
Simply download and unzip the attached file and then install it like a regular add-on.
2. Manually editing the templates
The three templates you need to edit are:
- cta_featuredthreads_forum_list
- cta_featuredthreads_forum_view
- cta_featuredthreads_find_new_wrapper
cta_featuredthreads_forum_list
Code:
<xen:if is="!{$visitor.customFields.CtaFtForumList}">
Template code to hide when checkbox is checked.
</xen:if>
cta_featuredthreads_forum_view
Code:
<xen:if is="!{$visitor.customFields.CtaFtForumView}">
Template code to hide when checkbox is checked.
</xen:if>
cta_featuredthreads_find_new_wrapper
Code:
<xen:if is="!{$visitor.customFields.CtaFtNewRecent}">
Template code to hide when checkbox is checked.
</xen:if>
3. Creating template modifications
In order to do this you must have debug mode enabled.
Once that is done, you must create three separate template modifications.
The find code for each one is the current template contents.
The replace code for each one is the current template contents wrapped in the corresponding custom user field conditional statement, as above.
- Related resources