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

XF 1.5 how to include a template in this scenario?

Discussion in 'XenForo Questions and Support' started by Blast, May 14, 2016.

  1. Blast

    Blast Active Member

    i want to add the thread watchers to this tempalte:

    Code:
    <xen:description>
        {xen:phrase discussion_in_x_started_by_y_date_z,
            'forum=<a href="{xen:link forums, $forum}">{$forum.title}</a>',
            'name={xen:helper username, $thread}',
            'date=<a href="{xen:link threads, $thread}">{xen:datetime $thread.post_date, html}</a>'}
    </xen:description>
    I want to add this code:
    <xen:include template="thread_view_watchers" />

    After this:
    'date=<a href="{xen:link threads, $thread}">{xen:datetime $thread.post_date, html}</a>'

    Looking at the template, I only want to add this:
    Code:
    'count={xen:number $watchers}', 'link={xen:link threads/watchers, $thread}'
     
  2. Arty

    Arty Well-Known Member

    Try this
    Code:
    <xen:set var="$threadViewContent"><xen:include template="thread_view_watchers" /></xen:set>
    <xen:description>
        {xen:phrase discussion_in_x_started_by_y_date_z,
            'forum=<a href="{xen:link forums, $forum}">{$forum.title}</a>',
            'name={xen:helper username, $thread}',
            'date=<a href="{xen:link threads, $thread}">{xen:datetime $thread.post_date, html}</a>{xen:raw $threadViewContent}'}
    </xen:description>
     
    Steve F likes this.
  3. Blast

    Blast Active Member

    Hey Arty. Thanks, but what I did was copy the content of the phrase from thread watchers and used it on the
    {xen:phrase discussion_in_x_started_by_y_date_z instead.

    Thanks for the help though. That reminds me, where can I find the tutorial on how you did that?
     

Share This Page