Widget logic
Unsolved
Technical Support
-
@baris Seems I can do most of this in a standard HTML widget - I'm only missing the OP ID and the logged in user ID for analysis in relation to triggering the message or not - an example below
<!-- IF isQuestion --> <!-- IF !isSolved --> <div class="bmacmain"> <div class="card"><h5 class="card-header">Did this topic help you?</h5><div class="card-body"> <div class="bmacmessage">Please don't forget to click on "Mark this post as the correct answer" whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. </div> </div> </div></div> <br> <style> #bmac { display: none; } </style> <!-- ENDIF !isQuestion --> <!-- ENDIF !isSolved -->
-
@baris Thanks. This works
<!-- IF isQuestion --> <!-- IF !isSolved --> < script > {{ if (uid === loggedInUser.uid) }} </script> <div class = "bmacmain" > <div class = "card" > <h5 class = "card-header" > Did this topic help you ? < /h5> <div class="card-body"> <div class = "bmacmessage" > Please don 't forget to click on "Mark this post as the correct answer" whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. < /div> </div> </div> </div> <br> <script> {{ end }} </script> <!-- ENDIF !isQuestion --> <!-- ENDIF !isSolved -->
-
Hmm - not working entirely - it is triggering no matter who the OP is
<script> {{{ if (uid === loggedInUser.uid) }}} </script> <!-- IF isQuestion --> <!-- IF !isSolved --> <div class="bmacmain"> <div class="card"><h5 class="card-header">Did you get the answer you needed?</h5><div class="card-body"> <div class="bmacmessage">Hey <span class="topicUsername" ><span class="username"></span></span>. It looks as though there have been one or more replies to your original post. <br>If a provided answer resolved an issue for you, Could you please take a moment, and select "Mark this post as the correct answer" in the corresponding response? <br><br>By doing this, it means that original posters help the rest of the community find answers to previously asked questions by identifying the correct answer. </div> </div> </div></div> <br> <!-- ENDIF !isQuestion --> <!-- ENDIF !isSolved --> <script> {{{ end }}} </script>
Still lookin at this, but any thoughts ?
-
You don't have to put that in
<script>
tags. It is valid benchpress so you can use something like this.{{{ if (uid == loggedInUser.uid) }}} {{{ if isQuestion }}} {{{ if !isSolved }}} <div class="bmacmain"> <div class="card"><h5 class="card-header">Did you get the answer you needed?</h5><div class="card-body"> <div class="bmacmessage">Hey <span class="topicUsername" ><span class="username"></span></span>. It looks as though there have been one or more replies to your original post. <br>If a provided answer resolved an issue for you, Could you please take a moment, and select "Mark this post as the correct answer" in the corresponding response? <br><br>By doing this, it means that original posters help the rest of the community find answers to previously asked questions by identifying the correct answer. </div> </div> </div></div> <br> {{{ end }}} {{{ end }}} {{{ end }}}
-
I would recommend combining those ifs:
{{{ if (((uid == loggedInUser.uid) && isQuestion) && !isSolved) }}}
Copyright © 2024 NodeBB | Contributors