XF 2.1 How to use strpos in templates xenforo 2.1

adeel786

Member
I want to do something like
  1. if featured image present show featured image
  2. else if thread first post message contain Media='youtube' tag show bbcode
  3. else show website logo

    <xf:if is="$thread.custom_fields.FeaturedThumbs">
    <img src="/forums/images/thumb_cache/{$thread.thread_id}.jpg" />

    <xf:elseif is="{{ strpos($thread.FirstPost.message, 'MEDIA=youtube') !== false }}" />
    <div class="tooltip-content-inner">
    {{ bb_code($thread.FirstPost.message, 'post:thread_preview', $thread.FirstPost, {
    'lightbox': false
    }) }}
    </div>
    <xf:else />
    <img src="websiteLogo" />
    </xf:if>
 
Back
Top Bottom