Using three mustaches in the template not giving expected outcome

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I am using the template in a table to create a hyperlink to a different Skuid page. What I did here -

{{Name}}

It should create a hyperlink to the page but instead of that it is redirecting me to the detail page of the record. Please help me out.
Photo of Naval

Naval

  • 140 Points 100 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hi Naval,

Are you trying to set up a link to another Skuid page? If so, that other Skuid page will need the relevant model to have a condition that takes its Id# from the URL parameter you have in your example URL. The condition should be set to "always on."

Other things to consider:

-It's best to use use triple mustaches instead of double mustaches anyplace that Skuid should NOT link to that record's detail page. A field reference that's enclosed in double mustache includes the field's metadata, and therefore will render as a link to the detail page, while the triple mustaches will only include the field data itself (the Id# itself, in this case). 

-Your template field needs to have "Allow HTML" enabled for this to link properly.
(Edited)
Photo of Naval

Naval

  • 140 Points 100 badge 2x thumb
Hi Mark,

Thanks for your quick reply.

I am doing exactly what you mentioned in your reply. But it's not creating a link to the Skuid page. It always creates link to the detail page irrespective of what I put in the "href" attribute of the anchor tag.
(Edited)
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hi Naval, I've built a template field on my Accounts table using this format:

<a href="apex/skuid__ui?page=AccDetailPage&Id={{{Id}}}" target="_blank">{{{Name}}}</a>

If the Name field is enclosed in double mustaches instead of triple mustaches, the link won't be built the way you specify - Skuid will use the field's metadata and will link to the record's default detail page, and that sounds like might be happening to your links.  As long as the box is checked to allow HTML, clicking the link will open the page "AccDetailPage." The AccDetailPage has a model on the Account object, and a condition on the model that looks like this:

(Edited)
Photo of Naval

Naval

  • 140 Points 100 badge 2x thumb
Hi Mark,

You are awesome. Now it's working for me.

Thanks a ton!
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
The name and reference field will likely always redirect you to the detail page of the record. You could create a UI only formula field and set it equal to {{Name}}. Then use the UI only field in your template. This should strip the automatic redirect to the detail page
Photo of Naval

Naval

  • 140 Points 100 badge 2x thumb
Hi Raymond,

Thanks for your reply. I used Mark's solution and it worked for me.

Thanks again!