XF 2.0 Conditional Statement In Submit Tag

kingjavo

Active member
Anyone know how to add a conditional if statement inside the "submit" tag?

ORIGINAL
PHP:
<xf:submitrow submit="{{ phrase('post_thread') }}" icon="write" sticky="true">

NEW
PHP:
<xf:submitrow submit="<xf:if is='{$forum.node_id} == 116'>Create Ticket<xf:else />{{ phrase('post_thread') }}</xf:if>" icon="write" sticky="true">
 
Just a heads up in case anyone else needs the answer, shorthand works with the submitrow's

Template: forum_post_quick_thread & forum_post_thread
forum_post_quick_thread

Find:
Code:
{{ phrase('post_thread') }}

Replace with:
Code:
{{ $forum.node_id == '116' ? 'Create Ticket' : 'Post Thread' }}
 
Back
Top Bottom