We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23838
    • 11 Posts
    Hi forum,

    I’ve added a site address custom field (not a required field) to my comments form, which if entered turns the comment user name into a clickable URL to their site. It’s working, but at the moment the username is always a link, even if the commenter has not entered a URL. So what I want to do is to check if the field is empty first, and if yes then the username is not clickable (not a link), if no then the username stays as a link.

    So I’m guessing what I need is some sort of conditional statement in the chunk.comment.inc.html, just before my <a href="http://[+comment.custom.webadd+]">.......

    Here’s the code as it is now:

    <div class="jot-user">
          <a href="http://[+comment.custom.webadd+]">
          [+comment.createdby:isnt=`0`:then=`<b>`+][+comment.createdby:userinfo=`username`:ifempty=`[+comment.custom.name:ifempty=`[+jot.guestname+]`:esc+]`+][+comment.createdby:isnt=`0`:then=`</b>`+]
          </a>
          <br />
          </div>


    If anyone can help me with this it would be greatly appreciated!
    Preddz
      • 1122
      • 209 Posts
      <div class="jot-user">
            [+comment.custom.webadd:isnt=``:then=`<a href="http://[+comment.custom.webadd+]">`+]
            [+comment.createdby:isnt=`0`:then=`<b>`+][+comment.createdby:userinfo=`username`:ifempty=`[+comment.custom.name:ifempty=`[+jot.guestname+]`:esc+]`+][+comment.createdby:isnt=`0`:then=`</b>`+]
            [+comment.custom.webadd:isnt=``:then=`</a>`+]
            <br />
            </div>
      
        • 23838
        • 11 Posts
        Quote from: alik at Feb 13, 2010, 03:40 PM

        <div class="jot-user">
              [+comment.custom.webadd:isnt=``:then=`<a href="http://[+comment.custom.webadd+]">`+]
              [+comment.createdby:isnt=`0`:then=`<b>`+][+comment.createdby:userinfo=`username`:ifempty=`[+comment.custom.name:ifempty=`[+jot.guestname+]`:esc+]`+][+comment.createdby:isnt=`0`:then=`</b>`+]
              [+comment.custom.webadd:isnt=``:then=`</a>`+]
              <br />
              </div>
        


        Thanks - works perfectly!