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


Discussion in 'XenForo Questions and Support' started by DBA, Jan 10, 2012.

  1. DBA

    DBA Well-Known Member

    I'm having a little trouble figuring out how to do a certain conditional. I made some changes to the message template however I've since noticed that both the post view and conversation view use this template. What (else) conditional would I use to only have these changes applied to the post view only? For example:

    <xen:if is="conversation">
    This shows on conversations only
    <xen:else />
    This shows everywhere else

    Also would this same conditional work in the PAGE_CONTAINER? For example:

    <xen:if is="post view">
    Show this while viewing a thread
    <xen:else />
    This shows everywhere else
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. DBA

    DBA Well-Known Member

  4. Brogan

    Brogan XenForo Moderator Staff Member

  5. DBA

    DBA Well-Known Member

    I still can't seem to figure it out. Here's what I'm trying to do.

    I added a green header to my posts and it looks like this.

    However this applied the same styling to the conversations and also made the times incorrect.

    So now I'm trying to get a conditional that will show my post header code only in the posts and not in the conversations.

    Here's the post header code that I currently have in the message template.
    <div id="dba_message_header"> <!-- taken from post -->
    <div id="dba_message_hl">
                    <xen:if is="{$post.canInlineMod}"><input type="checkbox" name="posts[]" value="{$post.post_id}" class="InlineModCheck item" data-target="#post-{$post.post_id}" title="{xen:phrase select_this_post_by_x, 'name={$post.username}'}" /></xen:if>
                    <span id="item muted">
    <xen:comment>                    <xen:username user="$post" class="author" />,</xen:comment>
                        <a href="{xen:link threads/post-permalink, $thread, 'post={$post}'}" title="{xen:phrase permalink}" class="datePermalink"><xen:datetime time="$post.post_date" /></a>
    <div id="dba_message_hr">
                    <a href="{xen:link threads/post-permalink, $thread, 'post={$post}'}" title="{xen:phrase permalink}" class="item muted postNumber hashPermalink OverlayTrigger" data-href="{xen:link posts/permalink, $post}">#{xen:calc '{$post.position} + 1'}</a>
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Have you tried wrapping the post header code in: <xen:if is="!{$message.conversation_id}">...</xen:if>

    Or alternatively, have you tried just adding some CSS to EXTRA.css for the thread posts only?
    DBA likes this.
  7. DBA

    DBA Well-Known Member

    That worked, thanks Brogan!

    Someday I'll have a better grasp on the more complex conditionals. :cool:
    Yes, however I also moved some of the code up there (Time stamp and post number).

Share This Page