• 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."

erich37

Well-known member
#1
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!
 

Jake Bunce

XenForo moderator
Staff member
#2
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

Well-known member
#3
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".