Card Component Links - Child Pages

Hello all-

The Tada Team has come through again with outstanding customer support! @Lee (and I am sure others) have helped me create javascript that will make Card Components linked to subpages of the record. The following code is needed on the page the Card is located on:

var recordID;
TB.render('component_3', function (data) {
    recordID = data.record.id;
});
TB.render('component_80',function(data){
  data.ele.on('click',function(){
      window.location.href = '/sicc-demo#!/incidents/announcements/'+recordID;
  });
});
TB.render('component_37',function(data){
  data.ele.on('click',function(){
      window.location.href = '/sicc-demo#!/incidents/do-intake-log/'+recordID;
  });
});
TB.render('component_68',function(data){
  data.ele.on('click',function(){
      window.location.href = '/sicc-demo#!/incidents/ics-213rr/'+recordID;
  });
});
TB.render('component_29',function(data){
  data.ele.on('click',function(){
      window.location.href = '/sicc-demo#!/incidents/ics-233/'+recordID;
  });
});

Instructions:
component_3 = is referenced to pull the record ID. We pull it from the detail component (component_3) on the page. (See picture below)
component_XX = is the component ID of the card you want to create a link (in Page Builder hover over the ā€œiā€ tooltip icon to reveal the ID - see picture below)
APPNAME#!/PARENT-PAGE/CHILD-PAGE-SLUG = the sub-page (child page) link you want the card to link to.

I had 4 different cards on the same page. Thus, you will see 5 duplicate lines of code with different component IDs. If you less or more just delete/add additional lines (example lines below).

TB.render('component_29',function(data){
  data.ele.on('click',function(){
      window.location.href = '/sicc-demo#!/incidents/ics-233/'+recordID;
  });
});

Hope this helps!

1 Like