Link to Permalink.

By gregThomas - March 31, 2016

Hey Tim, 

I've done some local testing, and this should work:

<?php

  // load records from 'events'
  list($musicRecords, $musicMetaData) = getRecords(array(
  'tableName' => 'music',
  'loadUploads' => true,
  'allowSearch' => false,
  'leftJoin'    => array('artists' => 'artist'),
  ));

?>
<?php foreach ($musicRecords as $record): ?>
  <a href="<?php echo htmlencode($record['artists.permalink']) ?>"><?php echo htmlEncode($record['artists.title']); ?></a><br>
<?php endforeach; ?>

So the above code left joins to the artist table so that we have access to all of the artist fields.

Then you can cycle through  the music records and display the artist permalink by prefixing any artist field with artists. 

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Toledoh - March 31, 2016

Great!  I've added a leading forward slash to bring it back the the base.

Thanks!

Cheers,

Tim (toledoh.com.au)