• 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?

Itworx4me

Well-known member
#1
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
 

Brogan

XenForo moderator
Staff member
#2
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.
 

Brogan

XenForo moderator
Staff member
#4
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

Well-known member
#5
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?
 

Brogan

XenForo moderator
Staff member
#6
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.
 

Lawrence

Well-known member
#7
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">
 

Brogan

XenForo moderator
Staff member
#8
Nice one Lawrence.

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

Lawrence

Well-known member
#9
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.
 

Tilkißey

Well-known member
#10
Works for thread_view template, not the message template. Been too long, grrrr. Still testing.

ok, got it: in the message template (not thread_view), find:
**codes here**
Change the forum title to the forum's title you do not want the posters info block to appear.

As Brogan stated you do need to change the css to reclaim the unused white space.
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>
 

Lawrence

Well-known member
#11
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>
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>
 

Brogan

XenForo moderator
Staff member
#15
I'm not sure I understand.

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

ManuTdi

Active member
#19
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>
I customize the css as the first message? to introduce code to recognize the plantilla.css?