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

XF 1.5 reply button at top of thread list?

Discussion in 'Styling and Customization Questions' started by sross, Feb 12, 2016.

  1. sross

    sross Active Member

    Hi, can someone tell me how to add a reply button to the top of thread view? Thanks
     
  2. wang

    wang Well-Known Member

    Can you please screenshot the place where you want to add it?
     
  3. sross

    sross Active Member

    basically right above selected posts

    Screen Shot 2016-02-13 at 10.18.28 AM.png
     
  4. wang

    wang Well-Known Member

    You must edit the thread_view template and add your code below this code.

    HTML:
    <xen:require css="thread_view.css" />
    And add float:right style to make it dsiplay where you want, like so.

    HTML:
    <span style="float:right">your code</span>
     
  5. sross

    sross Active Member

    Is there a generic reply code for threads (not a coder so would need full instructions). Thanks for the help!
     
  6. wang

    wang Well-Known Member

    Can you please define reply code for threads?
     
  7. sross

    sross Active Member

    I guess it's the same as the "More.." link at bottom of thread?
     
    wang likes this.
  8. Russ

    Russ Well-Known Member

    wang likes this.
  9. wang

    wang Well-Known Member

    If you want it to look like the More Options link, add this code:

    HTML:
    <div style="float:right">
    <xen:if is="{$canReply}">
        <a href="{xen:link 'threads/reply', $thread}"><input type="submit" class="button DisableOnSubmit" value="{xen:phrase more_options}..." name="more_options" /></a>
    </xen:if>
    </div>
    
    If you want the link to displayed as a simple reply button, follow the documentation above.
     
    sross likes this.
  10. sross

    sross Active Member

    sorry, your code has a smiley in it, can you clarify the code? thanks!
     
  11. wang

    wang Well-Known Member

    Now it displays correctly.
     
  12. sross

    sross Active Member

    that's very close, but I's like it above that, pretty much the same level as the title line. Thanks so far :)

    Screen Shot 2016-02-13 at 11.04.47 AM.png
     
  13. wang

    wang Well-Known Member

    You are welcome sir :)

    Did you add it after the part that I mentioned in my previous post? Did you wrap it up inside the div style with float right?

    Taking another look at your screenshot, it appears that you are using a custom style, and it might have changed things for that template. Because in a default style, it should have displayed above the selected posts link.
     
  14. sross

    sross Active Member

    yes it's custom style. Here is the top part of the template code if that sheds any light:

    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: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>
    
    <xen:container var="$head.canonical">
       <link rel="canonical" href="{xen:link 'canonical:threads', $thread, 'page={$page}'}" /></xen:container>
    <xen:container var="$head.description">
       <meta name="description" content="{xen:helper snippet, $firstPost.message, 155}" /></xen:container>
    <xen:container var="$head.openGraph"><xen:include template="open_graph_meta">
         <xen:set var="$url">{xen:link 'canonical:threads', $thread}</xen:set>
         <xen:set var="$title">{xen:helper threadPrefix, $thread, escaped}{$thread.title}</xen:set>
         <xen:set var="$description">{xen:helper snippet, $firstPost.message, 155}</xen:set>
         <xen:set var="$avatar">{xen:helper avatar, $thread, m, 0, 1}</xen:set>
       </xen:include></xen:container>
    <xen:container var="$bodyClasses">{xen:helper nodeClasses, $nodeBreadCrumbs, $forum}{xen:if {$xenOptions.selectQuotable}, ' SelectQuotable'}</xen:container>
    <xen:container var="$searchBar.thread"><xen:include template="search_bar_thread_only" /></xen:container>
    <xen:container var="$searchBar.forum"><xen:include template="search_bar_forum_only" /></xen:container>
    
    <xen:require css="thread_view.css" />
    <div style="float:right">
    <xen:if is="{$canReply}">
      <a href="{xen:link 'threads/reply', $thread}"><input type="submit" class="button DisableOnSubmit" value="Reply" name="more_options" /></a>
    </xen:if>
    </div>
    <xen:set var="$threadTagsHtml"><xen:if is="{$xenOptions.enableTagging} AND ({$canEditTags} OR {$thread.tagsList})">
       <xen:include template="helper_tag_list">
         <xen:map from="$thread.tagsList" to="$tags" />
         <xen:set var="$editUrl">{xen:if $canEditTags, {xen:link threads/tags, $thread}}</xen:set>
       </xen:include>
    </xen:if></xen:set>
     
  15. wang

    wang Well-Known Member

    I can not tell by that code only. The thread_view.css template might have been modified, or other stuff too.

    This is how it appears with the default style.

    screenshot.png

    I think it would be much better if you made a post at that style ' topic for this.
     
    sross likes this.
  16. sross

    sross Active Member

    ok thanks :)
     
    wang likes this.
  17. wang

    wang Well-Known Member

    No problem sir :)
     

Share This Page