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

linking of phrase: "There are no threads to display."

Discussion in 'Styling and Customization Questions' started by erich37, Jan 3, 2012.

  1. erich37

    erich37 Well-Known Member

    I have some Forum-Nodes which have no posts yet.

    Then there is the following "Phrase" showing up:
    "There are no threads to display."

    I would like to re-name this phrase into something like:
    "There are no threads to display. Create a New Thread now".

    Instead of having this phrase as a text, I would like to make this phrase into a Link, so that users can click on it.

    - when a visitor (user is not logged-in) clicks onto this Link, then it should open-up the "Login header-drop-down".
    - when a user is logged-in and is clicking onto this link, it should forward the user to "Create New Thread" of that specific Forum.

    Could you please help me with the code for this?


    Appreciate your help!
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> thread_list

    Add the red code:

    Code:
    		<xen:hook name="thread_list_threads">
    		<xen:foreach loop="$threads" value="$thread">
    			<xen:include template="thread_list_item" />
    		</xen:foreach>
    		</xen:hook>
    		
    		<xen:edithint template="thread_list_item_edit" />
    	<xen:else />
    		<li class="primaryContent">{xen:phrase there_no_threads_to_display} <a href="{xen:link 'forums/create-thread', $forum}">Create a New Thread now.</a></li>
    	</xen:if>
    	</ol>
    
    	<xen:if is="{$totalThreads} OR {$inlineModOptions}">
    		<div class="sectionFooter InlineMod SelectionCountContainer">
    			<xen:if is="{$totalThreads}"><span class="contentSummary">{xen:phrase showing_threads_x_to_y_of_z, 'start={xen:number $threadStartOffset}', 'end={xen:number $threadEndOffset}', 'total={xen:number $totalThreads}'}</span></xen:if>
    
     
    erich37 likes this.
  3. erich37

    erich37 Well-Known Member

    Many thanks Jake!

    does this also include this?

    - when a visitor (user is not logged-in) clicks onto this Link, then it should open-up the "Login header-drop-down".
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It will take them to a login page if they don't have permission to post.
     
    erich37 likes this.
  5. erich37

    erich37 Well-Known Member

    this works like a charm!

    Many thanks Jake!
     

Share This Page