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

New Thread, title header

toodlez

Active member
#1
Is there a way to change the display for a thread / title of thread when viewing it?

This is the way mine displays currently:
Screen shot 2011-12-04 at 1.35.03 PM.png

This is how I would like it to look (the avatar shown is the user who created the thread's avatar):
Screen shot 2011-12-03 at 7.47.56 PM.png
 

Jake Bunce

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

Add the red code near the top:

Code:
<xen:title>{xen:helper threadPrefix, $thread, escaped}{$thread.title}{xen:helper pagenumber, $page}</xen:title>
<xen:h1>{xen:helper threadPrefix, $thread}{$thread.title}</xen:h1>

<xen:container var="$beforeH1"><div style="float: left; margin-right: 10px;"><xen:avatar user="$firstPost" size="s" /></div></xen:container>

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

<xen:navigation>
	<xen:breadcrumb source="$nodeBreadCrumbs" />
</xen:navigation>
This works in 1.1
 

toodlez

Active member
#3
Admin CP -> Appearance -> Templates -> thread_view

Add the red code near the top:

Code:
<xen:title>{xen:helper threadPrefix, $thread, escaped}{$thread.title}{xen:helper pagenumber, $page}</xen:title>
<xen:h1>{xen:helper threadPrefix, $thread}{$thread.title}</xen:h1>
 
<xen:container var="$beforeH1"><div style="float: left; margin-right: 10px;"><xen:avatar user="$firstPost" size="s" /></div></xen:container>
 
<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>
 
<xen:navigation>
<xen:breadcrumb source="$nodeBreadCrumbs" />
</xen:navigation>
This works in 1.1
Hey Jake, this works for me... in a past thread we had added the node icons to the forum view page and it put the forum name and it's description on the same line...

How do I get the "Discussion in (forum name) started by .....
to be spaced on a second line below the thread title just like the example provided above?
 

toodlez

Active member
#6
Or another thing would be to lessen the vertical spacing between the Title and the description below it - or Board Title and description below it... so there is only a 1 px space between the two
 

Jake Bunce

XenForo moderator
Staff member
#7
You can set an exception for thread_view pages by adding the red code (following the code I already had you add from the previous thread):

Code:
#pageDescription,
.titleBar h1
{
	display: inline;
	vertical-align: -20px;
}

.thread_view #pageDescription,
.thread_view .titleBar h1
{
	display: block;
	vertical-align: 0px;
}
 

toodlez

Active member
#8
You can set an exception for thread_view pages by adding the red code (following the code I already had you add from the previous thread):

Code:
#pageDescription,
.titleBar h1
{
display: inline;
vertical-align: -20px;
}
 
.thread_view #pageDescription,
.thread_view .titleBar h1
{
 display: block;
 vertical-align: 0px;
}

Hey Jake,
The code you provided works as I wanted it, however it just uses the avatar of the user who has the top post on the thread's page... Not the Original Poster.. So if a thread is 5 pages long, and you are on the 3rd page, it uses the top poster on the 3rd page's avatar, not the original poster of the thread still
 

Jake Bunce

XenForo moderator
Staff member
#9
Good point. I didn't realize that. Use this instead (changes in blue):

Code:
<xen:title>{xen:helper threadPrefix, $thread, escaped}{$thread.title}{xen:helper pagenumber, $page}</xen:title>
<xen:h1>{xen:helper threadPrefix, $thread}{$thread.title}</xen:h1>

<xen:container var="$beforeH1"><div style="float: left; margin-right: 10px;"><xen:avatar user="$thread" size="s" /></div></xen:container>

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

<xen:navigation>
	<xen:breadcrumb source="$nodeBreadCrumbs" />
</xen:navigation>