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

How can I remove posters info in first post?

Discussion in 'XenForo Questions and Support' started by Itworx4me, Apr 27, 2011.

  1. Itworx4me

    Itworx4me Well-Known Member

    I would like to remove the posters info in the first post. I would also like to be able to control which forum the information is removed from. Can this be done?

    member info.png
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You can edit the thread_view template to achieve that:

    Change this:
    Code:
    <xen:include template="message_user_info">
        <xen:map from="$message" to="$user" />
    </xen:include>
    To this:
    Code:
    <xen:if is="!{$post.position} == 0">
        <xen:include template="message_user_info">
            <xen:map from="$message" to="$user" />
        </xen:include>
    </xen:if>
    You will need to apply some custom css though otherwise there will be a blank space where the message user info should be.
     
    Itworx4me likes this.
  3. Itworx4me

    Itworx4me Well-Known Member

    Thanks for the info Brogan. Worked like a charm.

    Can you help me out with this?

    Thanks,
    Itworx4me
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Here's a quick and dirty version.

    In the same template, look for:
    Code:
        <div class="messageInfo primaryContent">
    Replace with:
    Code:
    <xen:if is="!{$post.position} == 0">
        <div class="messageInfo primaryContent">
    <xen:else />
        <div style="margin:0">
    </xen:if>
    Ideally you want to replace the inline styling (<div style="margin:0">) with a new class and put the css for that class in EXTRA.css.
     
    Itworx4me likes this.
  5. Itworx4me

    Itworx4me Well-Known Member

    Thanks for the info Brogan.

    One last question... If I wanted to limit this to a few forums only and not all forums how would I accomplish this?
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    That might be a bit trickier.

    I currently use a condition <xen:if is="{$quickNavSelected} != 'node-55'"> to remove the breadcrumbs from a certain node, but that is in the PAGE_CONTAINER template.
    I'm not sure it's possible to achieve what you want in the thread_view template but I'll have a look when I get a chance.
     
  7. Lawrence

    Lawrence Well-Known Member

    I tested this in the thread_view template, and it works:

    <xen:if is="{$forum.title} == 'what the forums title is">

    </xen:if>

    I'm sure there is a better way (I just looked quickly) as you need to use the exact name of the forum title. For example:

    <xen:if is="{$forum.title} == 'General Support and Questions">
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    Nice one Lawrence.

    I wasn't aware that was a variable that could be used (I really need to check the complete list).
     
  9. Lawrence

    Lawrence Well-Known Member

    Works for thread_view template, not the message template. Been too long, grrrr. Still testing.

    ok, got it, not pretty but it works: in the message template (not thread_view), find:
    Code:
    <xen:include template="message_user_info">
    <xen:map from="$message" to="$user" />
    </xen:include>
    
    and replace with this:
    Code:
    <xen:if is="{$post.position} == '0'">
        <xen:if is="{$forum.title} != 'One for Testing'">
        <xen:include template="message_user_info">
            <xen:map from="$message" to="$user" />
        </xen:include>
        <xen:else />
      include the template containing the CSS over-ride here
        </xen:if>
    <xen:else />
        <xen:include template="message_user_info">
            <xen:map from="$message" to="$user" />
        </xen:include>
    </xen:if>
    
    Change the One for Testing to the forum's title you do not want the posters info block to appear in the first post.

    As Brogan stated you do need to change the css to reclaim the unused white space.
     
  10. Tilkißey

    Tilkißey Well-Known Member

    i changed a line for useful using

    HTML:
    <xen:if is="{$post.position} == '0'">
        <xen:if is="!in_array({$forum.node_id}, array(1,2,51,52))">
        <xen:include template="message_user_info">
            <xen:map from="$message" to="$user" />
        </xen:include>
        </xen:if>
    <xen:else />
        <xen:include template="message_user_info">
            <xen:map from="$message" to="$user" />
        </xen:include>
    </xen:if>
     
    Itworx4me and Lawrence like this.
  11. Lawrence

    Lawrence Well-Known Member

    Excellent, thanks! I been away from XenForo for a couple of months and checking for node_id slipped my mind.

    Code:
    <xen:if is="{$post.position} == '0'">
        <xen:if is="!in_array({$forum.node_id}, array(1,2,51,52))">
        <xen:include template="message_user_info">
            <xen:map from="$message" to="$user" />
        </xen:include>
        <xen:else />
      include the template containing the CSS over-ride here
        </xen:if>
    <xen:else />
        <xen:include template="message_user_info">
            <xen:map from="$message" to="$user" />
        </xen:include>
    </xen:if>
    
     
    Tilkißey and Itworx4me like this.
  12. Itworx4me

    Itworx4me Well-Known Member

    Thanks for everyone helping. I really appreciate it. :)
     
    Tilkißey likes this.
  13. It can apply this same

    but only for guest?
     
  14. ManuTdi

    ManuTdi Active Member

    @Brogan this is what I wanted when I commented on your addon CTA Featured.
    But this already built into your addon.
     
  15. Brogan

    Brogan XenForo Moderator Staff Member

    I'm not sure I understand.

    You can use conditional statements and custom CSS/templates to achieve it, but it's not built in.
     
  16. ManuTdi

    ManuTdi Active Member

    CTA Featured Threads & Portal [Paid]
     
  17. @Brogan
    It can apply this same

    <xen:if is="!{$post.position} == 0">
    <div class="messageInfo primaryContent">
    <xen:else />
    <div style="margin:0">
    </xen:if>

    but only for guest?

    thx
     
  18. Brogan

    Brogan XenForo Moderator Staff Member

  19. ManuTdi

    ManuTdi Active Member

    I customize the css as the first message? to introduce code to recognize the plantilla.css?
     

Share This Page