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

XF 1.4 Message and Thread Title

Jake Bunce

XenForo moderator
Staff member
#2
Admin CP -> Appearance -> Templates -> message

Add the red code:

Code:
		<xen:hook name="message_content" params="{xen:array 'message={$message}'}">
		<xen:if is="{$thread.title}">
		<div style="border-bottom: 1px solid #dddddd; padding-bottom: 5px; margin-bottom: 5px;">
			{$thread.title}
		</div>
		</xen:if>
		<div class="messageContent">		
			<article>
				<blockquote class="messageText ugc baseHtml{xen:if $message.isIgnored, ' ignored'}">
					<xen:include template="ad_message_body" />
					{xen:raw $message.messageHtml}
				</blockquote>
			</article>
			
			{xen:raw $messageContentAfterTemplate}
		</div>
		</xen:hook>
 
#3
Admin CP -> Appearance -> Templates -> message

Add the red code:

Code:
        <xen:hook name="message_content" params="{xen:array 'message={$message}'}">
        <xen:if is="{$thread.title}">
        <div style="border-bottom: 1px solid #dddddd; padding-bottom: 5px; margin-bottom: 5px;">
            {$thread.title}
        </div>
        </xen:if>
        <div class="messageContent">       
            <article>
                <blockquote class="messageText ugc baseHtml{xen:if $message.isIgnored, ' ignored'}">
                    <xen:include template="ad_message_body" />
                    {xen:raw $message.messageHtml}
                </blockquote>
            </article>
           
            {xen:raw $messageContentAfterTemplate}
        </div>
        </xen:hook>
Thanks alot Jake it works :)
 

viper357

Active member
#4
Admin CP -> Appearance -> Templates -> message

Add the red code:

Code:
        <xen:hook name="message_content" params="{xen:array 'message={$message}'}">
        <xen:if is="{$thread.title}">
        <div style="border-bottom: 1px solid #dddddd; padding-bottom: 5px; margin-bottom: 5px;">
            {$thread.title}
        </div>
        </xen:if>
        <div class="messageContent">     
            <article>
                <blockquote class="messageText ugc baseHtml{xen:if $message.isIgnored, ' ignored'}">
                    <xen:include template="ad_message_body" />
                    {xen:raw $message.messageHtml}
                </blockquote>
            </article>
         
            {xen:raw $messageContentAfterTemplate}
        </div>
        </xen:hook>
How could I do it so that the red code is not displayed in responsive view? I've tried to figure it out using Brogan's guides but I can't get my head around it? I have the thread title displaying next to the date and time in a post, but I want to hide the thread title in responsive view.

To do this I simply added {$thread.title} at the end of this line:
Code:
<a href="{xen:link threads/post-permalink, $thread, 'post={$post}'}" title="{xen:phrase permalink}" class="datePermalink"><span class="DateTime">{xen:datetime {$post.post_date}, 'absolute'} - {$thread.title}</span></a>
Spring Specials at Aquaria SA   Marine Aquariums South Africa.png

Thanks. :)
 

Jake Bunce

XenForo moderator
Staff member
#5
@viper357

Surround your code with a block with a class, such as:

Code:
<span class="myExtraThreadStuff">

</span>
Then add CSS to hide it in Responsive mode:

Admin CP -> Appearance -> Templates -> EXTRA.css

Code:
.Responsive .myExtraThreadStuff
{
	display: none;
}