Skip to main content

Hi Team!

I’m experimenting with the font awesome icons and skuid templates and was wondering if it is possible to trigger a snippet from a template field dropped in a table row (or anywhere for that matter).

My end result is a styled button or even just a font awesome icon by itself as a field anywhere in a table row (not table row action) that runs a snippet on click of the icon just like it would if a regular button in a page header or table row action icon was clicked.

Any help is greatly appreciated! My background is not in webdesign/coding so I’d need a bit of hand-holding to correctly design the template field html 🙂

Thank you in advance, 

Robin


Ok - I’m going to give you a simple answer first. This will show how to add an icon to the template field, and make it do somthing simple using HTML - like a redirect. Running a snippet is a different thing and a little more complicated. If this first answer doesn’t satisfy your use case, let me know and we can expand.


  1. Drag a template field into your table.

  2. Enter syntax like this in your field:

{{Name}}<a href = "http://www.google.com"; target = "_blank"><div class="sk-icon fa-anchor" style="float:right;"></div></a>

Lets parse that out a bit.

{{Name}}: this would be any merge field you want to add to the field. Remove if you just want the icon.


<a href = “http://www.google.com”; target = “_blank”> : This sets up the icon to link to some webpage. If it another skuid page the link would take the form: “/apex/skuid__ui?page=PageName”. You can also pass data into the HTML in order to make the link go to some specific record.

If you want the link to open in a new window - keep the target = “_blank” line. Otherwize it will open in the same window.


Replace the fa-anchor text with the name of the font awsome icon you want to include.

Hopefully this will get you going.


Hey Rob, 

Thank you for your quick and thorough reply! This indeed got me on the right track, everything was very clear and easy to follow.

I am now working on a scenario with a table containing many columns in which it would be beneficial to drop in image-based templates which execute table row action snippets in any column, not just via the standard row action icons on the very left or other global/mass actions.

If you don’t mind, I’d love to know more about how I would achieve this expanding on your tutorial above!

Much appreciated, 

Robin


Ha.  So you want the harder option…  Welcome to the dark side. 

What you will need to do is build a custom renderer snippet for the field you put in your table.  (Its really just a placeholder). 

Then in your snippet you need to get the image id and populate it into the field as within a div.  Then use jQuery to implement onclick actions on that image div to kick off the rest of your code. 

Look at this tutorial for a pretty good introduction to custom renderers


Got it! Makes sense. Will look into it and check back in if I run into any issues. Thank you for the help! …" Let the Skuid flow through you "…