1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unmaintained CTA Featured Threads User Preferences 1.1.0

Give your users the option to remove the featured threads blocks

  1. Brogan
    Compatible XF Versions:
    • 1.2
    • 1.3
    • 1.4
    • 1.5
    Additional Requirements:
    This add-on requires CTA Featured Threads.
    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-list-01.png forum-list-02.png forum-list-03.png

    Forum View
    forum-view-01.png forum-view-02.png forum-view-03.png

    New / Recent Posts
    new-recent-01.png new-recent-02.png new-recent-03.png

    The next step is to edit the templates.
    There are three ways of doing so, which are explained below:
    1. Installing the attached add-on
    2. Manually editing the templates
    3. Creating template modifications
    1. Installing the attached add-on
    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
    Essentially you just wrap the relevant code in a conditional statement related to the custom user field.

    <xen:if is="!{$visitor.customFields.CtaFtForumList}">
        Template code to hide when checkbox is checked.
    <xen:if is="!{$visitor.customFields.CtaFtForumView}">
        Template code to hide when checkbox is checked.
    <xen:if is="!{$visitor.customFields.CtaFtNewRecent}">
        Template code to hide when checkbox is checked.
    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.

    forum-list-04.png forum-view-04.png new-recent-04.png
    Related Resources:
    CTA Featured Threads & Portal
    Simon., thumped, Sami Jalal and 6 others like this.

Recent Updates

  1. Updated template modifications