Reference and Name custom field renderers that don't link

These are in the community already but thought that new users should have it easily searchable by title.

// this is the code that makes a non-reference field not link skuid.snippet.registerSnippet('DontLink',function(args) {var field = arguments[0], value = skuid.utils.decodeHTML(arguments[1]); if (field.mode !== 'edit') { field.element.append(skuid.$('<div>').addClass('nx-fieldtext').text(value)); // this code can be modified to meet the needs of the other modes } else { skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field,value); } }); // this is the code that makes a reference field not link skuid.snippet.registerSnippet('refDontLink',function(args) {var field = arguments[0], value = skuid.utils.decodeHTML(arguments[1]); if (field.mode !== 'edit') { field.element.append(skuid.$('<div>').addClass('nx-fieldtext').text(field.model.getFieldValue(field.row,skuid.utils.getFieldReference(field.id,field.metadata)))); // this code can be modified to meet the needs of the other modes } else { skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field,value); } });

Thanks for setting up the individual post Pat. 

Thank you for posting this here! Is there any reasonable explanation for why whenever I use a custom field renderer on one of my pages, all fields using the snippet get rendered correctly EXCEPT the first field on the page the snippet is applied to? Content just comes up as blank (doesn’t matter if the field is in a table, field editor, calendar, deck). If I implement a “refresh” button on the page, the error is resolved and it gets rendered correctly. If I load the page “fresh” in the browser, or use the browser’s “reload” function, the bug persists. 

Any suggestions are greatly appreciated!

Regards, 

Robin