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

XF 1.2 How to insert a single line content between thread search result?

Discussion in 'XenForo Questions and Support' started by RoldanLT, Sep 12, 2013.

  1. RoldanLT

    RoldanLT Well-Known Member

    For:
    • New Post
    • Keyword Search
    • Watched Threads List
    I tried: hook:thread_list_item_icon_key
    But it's show's in all thread.
    I want to show it once, Thanks!
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    What are you trying to accomplish? If you are using templates (pre-compiled) you could do:

    Code:
    <xen:if is="!$shown">
      <xen:set var="$shown" value="true" />
      <!-- show your content -->
    </xen:if>
    That should only show once.
     
  3. RoldanLT

    RoldanLT Well-Known Member

    Just like using this template: ad_thread_list_below_stickies
    Content will be shown below stickies.

    But with hook:thread_list_item_icon_key, I want to show it below the 1st thread/result.
     
  4. Jeremy

    Jeremy XenForo Moderator Staff Member

    The code I posted above, should work.
     
  5. RoldanLT

    RoldanLT Well-Known Member

    Having this error: Line 1: Invalid condition expression
    I created a new template from your code, then encountered that.
     
  6. Jeremy

    Jeremy XenForo Moderator Staff Member

    Code:
    <xen:set var="$shown" value="false" />
    <xen:if is="{$shown} == true">
      <xen:set var="$shown" value="true" />
      <!-- show your content -->
    </xen:if>
    (untested, but a variation of that should work)
     
    RoldanLT likes this.
  7. RoldanLT

    RoldanLT Well-Known Member

    I will try it later.
     

Share This Page