Wheres the code in the forum_view template for the thread titleBar

RobinHood

Well-known member
EDIT: I mean thread_view

I'm trying to move the thread title to above the first message of a thread, but I'm not sure which code I need to move in the thread_view template.

This is what I'm trying to do:

Before:
before.webp

After:
after.webp
 
Did it move? The pictures look the same.

I think you are looking for the h1 tag which is in the container:

Admin CP -> Appearance -> Templates -> PAGE_CONTAINER

Code:
						<xen:hook name="page_container_content_title_bar">
						<xen:if is="!{$noH1}">						
							<!-- h1 title, description -->
							<div class="titleBar">
								{xen:raw $beforeH1}
								<h1><xen:if
									is="{$h1}">{xen:raw $h1}<xen:elseif
									is="{$title}" />{xen:raw $title}<xen:else
									/>{$xenOptions.boardTitle}</xen:if></h1>
								
								<xen:if is="{$pageDescription.content}"><p id="pageDescription" class="muted {$pageDescription.class}">{xen:raw $pageDescription.content}</p></xen:if>
							</div>
						</xen:if>
						</xen:hook>
 
Yeah, it moved, it's hard to see in the default style as there's no lines borders that would highlight it, you can see that effectively the first message has been pushed down and the thread title is now inline with the sidebar.

I though that was the right code, I'd already tried it but it displays the name of the forum instead of the name of the thread when I move it to just below this code in the thread_view template:

Code:
<form action="{xen:link 'inline-mod/post/switch'}" method="post"
    class="InlineModForm section"
    data-cookieName="posts"
    data-controls="#InlineModControls"
    data-imodOptions="#ModerationSelect option">
 
    <ol class="messageList" id="messageList">

moving thread title 1.webp
 
Well, that code normally does not leave the container. thread_view passes the thread title to the h1 via this code:

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

Then in the rendered page the h1 is part of the container and comes before the contents of thread_view. So you are trying to arrange two things from different templates.

In looking at your pictures, can this problem not be reduced to simply moving the sidebar down? The h1 title looks to be in the same position. It's the sidebar that moves. What about just adding a top margin to your sidebar?
 
For that I suggesting removing the h1 by replacing this:

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

With:

Code:
<xen:h1></xen:h1>

Then you can create the new title area in thread_view.
 
Thanks Jake, I think I've managed to get it sorted now. I'm not sure I've done it the best way, but it seems to work.

All edits in the thread_view template.

On the second line I replaced:

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

with

Code:
<xen:h1></xen:h1>

Which stopped the thread title and description from being displayed in it's normal position.

Then to get it above the first post of the thread I inserted this:

Code:
                <div class="threadTitleBar">
                    <h1>{xen:helper threadPrefix, $thread}{$thread.title}</h1>   
                    <p id="pageDescription" class="muted ">
                    {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={xen:datetime $thread.post_date, html}'}
                    </p>
                </div>

Just after this:

Code:
    <div class="threadDiscussionList">
        <form action="{xen:link 'inline-mod/post/switch'}" method="post"
            class="InlineModForm section"
            data-cookieName="posts"
            data-controls="#InlineModControls"
            data-imodOptions="#ModerationSelect option">
       
            <ol class="messageList" id="messageList">

Then styled it all up using css :)
 
Back
Top Bottom