Website Sale Banner

🏷️ This Website is For Sale

Available Now

ℹ️ Reason for Sale: Due to limited availability, I am unable to continue maintaining the site at this time.

đź’° Pricing

$300

Flexible for negotiation

đź’ł Payment Method

PayPal (Friends & Family Only)

Secure transaction required

📦 What's Included

âś… All related files
âś… Complete database
❌ User data excluded
❌ Current theme excluded
❌ Domain excluded
❌ Hosting excluded

XF2 Tutorials Making a Watched Items Page

JowLix

XenForo Expert

Staff member
LIFETIME ELITE
Coin Coins
22,316
Making a Watched Items Page-1.webp

If you have a few add-ons then the amount of "watched items" spread across various menus can be a bit complicated and confusing. This simple template edit will give you a menu on each watched item page that links them all.

I did this in ten minutes. All the clever Xenforo template people may know better ways of doing this, feel free to chime in.

1. Make a new template called something like watched_items_macros

2. Paste this in:
HTML:
<xf:sidenav>
        <div class="block">
                <div class="block-container">
                    <h3 class="block-header">Watched Items</h3>
                    <div class="block-body">
<xf:macro name="links"
                            arg-pageSelected="{$xf.uri}"
                            arg-baseClass="blockLink"
                            arg-selectedClass="is-selected"
                            arg-user="{$user}" />    </div>
                </div>
            </div>

    </xf:sidenav>
<xf:macro name="links" arg-pageSelected="!" arg-baseClass="!" arg-selectedClass="!" arg-user="!">

<a class="{$baseClass} {{ $pageSelected == '/watched/threads' ? {$selectedClass} : '' }}"
        href="{{ link('watched/threads') }}" rel="nofollow">{{ phrase('watched_threads') }}</a>

<a class="{$baseClass} {{ $pageSelected == '/watched/forums' ? {$selectedClass} : '' }}"
        href="{{ link('watched/forums') }}" rel="nofollow">{{ phrase('watched_forums') }}</a>


<!-- the ones below are for add-ons I have - feel free to edit or delete this to suit which ones you have -->

<a class="{$baseClass} {{ $pageSelected == '/watched/wikipost' ? {$selectedClass} : '' }}"
        href="{{ link('watched/wikipost') }}" rel="nofollow">{{ phrase('wikipost_watched_wikiposts') }}</a>

<a class="{$baseClass} {{ $pageSelected == '/watched/ams-articles' ? {$selectedClass} : '' }}"
        href="{{ link('watched/ams-articles') }}" rel="nofollow">{{ phrase('xa_ams_watched_articles') }}</a>

<a class="{$baseClass} {{ $pageSelected == '/watched/ams-series' ? {$selectedClass} : '' }}"
        href="{{ link('watched/ams-series') }}" rel="nofollow">{{ phrase('xa_ams_watched_series') }}</a>

<a class="{$baseClass} {{ $pageSelected == '/watched/media' ? {$selectedClass} : '' }}"
        href="{{ link('watched/media') }}" rel="nofollow">{{ phrase('xfmg_watched_media') }}</a>

<a class="{$baseClass} {{ $pageSelected == '/watched/media-albums' ? {$selectedClass} : '' }}"
        href="{{ link('watched/media-albums') }}" rel="nofollow">{{ phrase('xfmg_watched_albums') }}</a>


</xf:macro>

3. Add the following at the bottom of every template you want to have the menu in.
HTML:
<xf:include template="watched_menu_macro" />

(If you type 'watched_' in the template filter, you should be able to find them -- ignore the ones that say 'manage' at the end of them)

4. That's it

5. Though you may want to go to the Public Navigation section and switch off all the Watched items in the various menus, and perhaps make a new Watched Content one that links to /watched/threads (perhaps under what's new)
 
Similar threads Most view View more
Back
Top