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

New Thread, title header

Discussion in 'Styling and Customization Questions' started by toodlez, Dec 4, 2011.

  1. toodlez

    toodlez Active Member

    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
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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
     
  3. toodlez

    toodlez Active Member

    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?
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  5. toodlez

    toodlez Active Member

  6. toodlez

    toodlez Active Member

    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
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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;
    }
    
     
  8. toodlez

    toodlez Active Member


    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
     
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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>
    
     

Share This Page