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

How do I place a custom message above a specific thread?

Discussion in 'General XenForo Discussion and Feedback' started by cmeinck, Mar 6, 2013.

  1. cmeinck

    cmeinck Well-Known Member

    It's increasing more important for webmasters to reduce their bounce rate. Forums can generate very high bounce rates and it can happen on your highest performing pages. My site has tutorials that cover a range of material related to my forum content. Is there a way to place a link or notice on a specific thread, so that visitors will be enticed to click on the link to view a tutorial that might answer their question more so than the thread.

    Customer searches for content related to 'blue widgets'. Specific forum thread ranks high for 'blue widgets', but the content is about yellow widgets. You place a notice or link above beneath thread title directing them to a blog post (or other forum thread) about 'blue widgets'.

    This is a manual activity, but it will lower you bounce rate and improve the experience for users seeking information.

    Is there something we have in resources that would enable this sort of customization?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Edit this template:

    Admin CP -> Appearance -> Templates -> thread_view

    Add this line to the top of the template:

    Code:
    <xen:container var="$threadId">{$thread.thread_id}</xen:container>
    
    Now you can use {$threadId} in the PAGE_CONTAINER template:

    Admin CP -> Appearance -> Templates -> PAGE_CONTAINER

    Add the red code:

    Code:
    			<xen:if is="{$sidebar}">
    				<div class="mainContainer">
    					<div class="mainContent"></xen:if>
    						
    						<xen:include template="ad_above_top_breadcrumb" />
    
    						<xen:if is="{$threadId} == 2">
    							<p class="importantMessage">
    								THIS MESSAGE WILL SHOW IN THE SPECIFIED THREADID
    							</p>
    						</xen:if>
    
    						<xen:hook name="page_container_breadcrumb_top">
    						<div class="breadBoxTop">
    							<xen:if is="{$topctrl}"><div class="topCtrl">{xen:raw $topctrl}</div></xen:if>
    							<xen:include template="breadcrumb"><xen:set var="$microdata">1</xen:set></xen:include>
    						</div>
    						</xen:hook>
    
    Screen shot 2013-03-06 at 7.05.42 PM.png
     
    Dodgeboard, Jeremy, cmeinck and 2 others like this.
  3. le-melvin

    le-melvin Member

    thank you
     
  4. HenrikHansen

    HenrikHansen Well-Known Member

    Using xfrocks widget framework addon you can do this without manually editing templates (if you in future wants to use it more)
     

Share This Page