XF 2.2 How to hide a widget using display conditions on a specific page?

Ferry

Member
Hi,
Looks like I'm making a mistake somewhere in the display condition.
I need to hide a widget from multiple pages, but nothing works.

If I use
Code:
$xf.reply.template !== 'whats_new'
it works.
But when trying to add another page nothing works
Code:
$xf.reply.template !== 'whats_new, whats_new_profile_posts'

What am I doing wrong?
 
I did something like this for a widget that I wanted to show certain things from depending on the situation. You may be able to adapt it for what you want: Edit! Ninjad in solution post lol

Code:
<xf:foreach loop="$threads" value="$thread">
                                <xf:if is="in_array($thread.node_id, [2,3,4,5,6,7,8,9])">
                            <li class="block-row">
                                <a href="{{ link('threads', $thread) }}" rel="nofollow"><img class="moviePoster" src="https://image.tmdb.org/t/p/w342{$thread.Movie.tmdb_image}"/></a>
                                <xf:macro template="thread_list_macros" name="item_new_threads"
                                    arg-thread="{$thread}" />
                            </li>
                                   
                                    </xf:if>
                                <xf:if is="in_array($thread.node_id, [21,22,23,24,25,26,27,28])">
                            <li class="block-row">
                                <a href="{{ link('threads', $thread) }}" rel="nofollow"><img class="tvPoster" src="{$thread.TV.getImageUrl('l')}" /></a>
                                <xf:macro template="thread_list_macros" name="item_new_threads"
                                    arg-thread="{$thread}" />
                            </li>
                                    </xf:if>
                        </xf:foreach>
 
I did something like this for a widget that I wanted to show certain things from depending on the situation. You may be able to adapt it for what you want:

Code:
<xf:foreach loop="$threads" value="$thread">
                                <xf:if is="in_array($thread.node_id, [2,3,4,5,6,7,8,9])">
                            <li class="block-row">
                                <a href="{{ link('threads', $thread) }}" rel="nofollow"><img class="moviePoster" src="https://image.tmdb.org/t/p/w342{$thread.Movie.tmdb_image}"/></a>
                                <xf:macro template="thread_list_macros" name="item_new_threads"
                                    arg-thread="{$thread}" />
                            </li>
                                   
                                    </xf:if>
                                <xf:if is="in_array($thread.node_id, [21,22,23,24,25,26,27,28])">
                            <li class="block-row">
                                <a href="{{ link('threads', $thread) }}" rel="nofollow"><img class="tvPoster" src="{$thread.TV.getImageUrl('l')}" /></a>
                                <xf:macro template="thread_list_macros" name="item_new_threads"
                                    arg-thread="{$thread}" />
                            </li>
                                    </xf:if>
                        </xf:foreach>
Appreciated it, it might be useful for the future
 
Top Bottom