Reference and Name custom field renderers that don't link

Pat VachonPat Vachon 💎💎💎
edited June 26, 2018 in Ideas
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);      }  });
3
3 votes

Implemented · Last Updated

Comments

  • Rob HatchRob Hatch 💎💎💎
    edited September 1, 2016
    Thanks for setting up the individual post Pat. 
  • edited June 16, 2018
    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
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!