display a hyperlink in a table field

  • 2
  • Question
  • Updated 2 years ago
I want to display a field in a table that has a hyperlink written into it. 
similar to this: "Here is some information about <a id="oppLink" href = ???>this</a>; record."
How do I get that to display with the actual hyperlink in my table?
Photo of Jerry

Jerry

  • 1,150 Points 1k badge 2x thumb

Posted 2 years ago

  • 2
Photo of Jared Jones

Jared Jones

  • 2,214 Points 2k badge 2x thumb
The best way I've found is to have Skuid build the link.

Set the column to display a template.  Check "Allow HTML".  The template will look something like this:

<a href="/{{{Id}}}">{{Id}}</a>
Photo of Jerry

Jerry

  • 1,150 Points 1k badge 2x thumb
My issue is that the link I need is already built into the value of the field I'm referencing. I need to display the normal text parts as normal text and format the html that is in there already.
Photo of Jared Jones

Jared Jones

  • 2,214 Points 2k badge 2x thumb
I don't have a field like that to test with.  However, this is what I would try:

Set the column to template
Check "Allow HTML"

For the template, put the field that contains your link in triple curly braces (displays the content of the field without any Skuid interference)

{{{FieldWithLink__c}}}

If the field is not part of the same model used for the table, you'll need different syntax.
Photo of Jerry

Jerry

  • 1,150 Points 1k badge 2x thumb
lol That's what I tried right before I made this topic. 
Photo of Jared Jones

Jared Jones

  • 2,214 Points 2k badge 2x thumb
Sounded good to me!  Hope someone else can lend a hand.  Good Luck, Jerry.
Photo of Jerry

Jerry

  • 1,150 Points 1k badge 2x thumb
SOLVED: I use a js snippet:
<code>
var params = arguments[0],
$ = skuid.$;

var row = params.row;

field.element.html(row.Error_Message__c);
</code>
Photo of Don Souza

Don Souza, Employee

  • 1,160 Points 1k badge 2x thumb
Yes, the template approach works well.