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

Template modification to move forum title into breadcrumb?

Discussion in 'XenForo Questions and Support' started by RobParker, Feb 9, 2011.

  1. RobParker

    RobParker Well-Known Member

    Screen shot 2011-02-09 at 20.18.46.png

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

    Jake Bunce XenForo Moderator Staff Member

    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>
    
     
    Skylined, Bram and RobParker like this.
  3. RobParker

    RobParker Well-Known Member

    Thanks, that's a huge help
     
  4. Bram

    Bram Well-Known Member

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

    Jake Bunce XenForo Moderator Staff Member

    Yep.
     
    Bram likes this.
  6. Bram

    Bram Well-Known Member

    Thanks, I did it right for a change :)
     
  7. byseca

    byseca Member

    thanks jake
     
  8. reddy ink

    reddy ink Active Member

    @Jake Bunce
    Can you help me with modification required to move resource title into breadcrumb. Thanks a lot!
    upload_2015-12-27_23-26-15.png
     

Share This Page