AnsweredAssumed Answered

Identify widget display field value as a hyperlink

Question asked by zhouxinyu7 on Sep 13, 2018
Latest reply on Sep 14, 2018 by rscheitlin

I am trying to customize Robert Scheitlin's identify widget so that so that the identify result shows field value as a hyperlink if the field value is a url.

Here is what I add in the showIdentifyResults module in the widget.js after line 1297 ( I am using widget version 2.7)

 

     content = content + this.resultFormatString.replace('[attribname]', fld).replace('[attribvalue]', value);
    /////////customize to create a hyper link for a field if the value is a url. Field value start with http or https
      if (value.search("http:") == 0 || value.search("https:") == 0) {
       content.replace(value, '<a href="' + value + '">open link</a>');

      }

The "content" doesn't change. Anybody has done that before?

Thanks

Helen

Outcomes