Template modification to move forum title into breadcrumb?

RobParker

Well-known member
Screen shot 2011-02-09 at 20.18.46.webp

I think this should be a straightforward template mod. The forum title currently takes up quite a lot of room which I'd rather put an advert in. I'd like to move the forum title into the breadcrumb trail.

When in a thread the forum title moves into the breadcrumb and it's the thread title which would need moving. I assume that's a couple of different templates (whatever the equivalents to forumdisplay and showthread are?).

Is that simple enough to do?
 
To add breadcrumbs you need to edit the content template for the page (see this thread). For example:

Admin CP -> Appearance -> Templates -> thread_view

Replace this:

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

with this:

Code:
<xen:navigation>
	<xen:breadcrumb source="$nodeBreadCrumbs" />
	<xen:breadcrumb href="{xen:link full:threads, $thread}">{$thread.title}</xen:breadcrumb>
</xen:navigation>

That will add the thread title to the breadcrumbs on thread pages.

_____

To remove the title from the original location you can edit the same template:

Admin CP -> Appearance -> Templates -> thread_view

Replace this:

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

with this:

Code:
<xen:h1>&nbsp;</xen:h1>

Note that if you use an empty value or completely remove the xen:h1 tag then it also removes the description. That is why I used a &nbsp;.

Or you can edit this template to remove the h1 title from all pages (effectively ignoring the xen:h1 values from all content templates):

Admin CP -> Appearance -> Templates -> PAGE_CONTAINER

Replace this:

Code:
						<xen:if is="!{$noH1}">
							<!-- h1 title, description -->
							<div class="titleBar">
								<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>

with this:

Code:
						<xen:if is="!{$noH1}">
							<!-- h1 title, description -->
							<div class="titleBar">

								<xen:if is="{$pageDescription.content}"><p id="pageDescription" class="muted {$pageDescription.class}">{xen:raw $pageDescription.content}</p></xen:if>
							</div>
						</xen:if>
 
@Jake Bunce

For the forum_view template this should be the correct replacement I guess?

<xen:navigation>
<xen:breadcrumb source="$nodeBreadCrumbs" />
<xen:breadcrumb href="{xen:link full:forums, $forum}">{$forum.title}</xen:breadcrumb>
</xen:navigation>
 
To add breadcrumbs you need to edit the content template for the page (see this thread). For example:

Admin CP -> Appearance -> Templates -> thread_view

Replace this:

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

with this:

Code:
<xen:navigation>
    <xen:breadcrumb source="$nodeBreadCrumbs" />
    <xen:breadcrumb href="{xen:link full:threads, $thread}">{$thread.title}</xen:breadcrumb>
</xen:navigation>

That will add the thread title to the breadcrumbs on thread pages.

_____

To remove the title from the original location you can edit the same template:

Admin CP -> Appearance -> Templates -> thread_view

Replace this:

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

with this:

Code:
<xen:h1>&nbsp;</xen:h1>

Note that if you use an empty value or completely remove the xen:h1 tag then it also removes the description. That is why I used a &nbsp;.

Or you can edit this template to remove the h1 title from all pages (effectively ignoring the xen:h1 values from all content templates):

Admin CP -> Appearance -> Templates -> PAGE_CONTAINER

Replace this:

Code:
                        <xen:if is="!{$noH1}">
                            <!-- h1 title, description -->
                            <div class="titleBar">
                                <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>

with this:

Code:
                        <xen:if is="!{$noH1}">
                            <!-- h1 title, description -->
                            <div class="titleBar">

                                <xen:if is="{$pageDescription.content}"><p id="pageDescription" class="muted {$pageDescription.class}">{xen:raw $pageDescription.content}</p></xen:if>
                            </div>
                        </xen:if>

XF 2 How To Make _?
 
Top Bottom