January 15, 201313 yr Let’s see if I can explain this in a coherent manner. I am displaying fields in a table view of records in a php webpage. I need to hyperlink the values in the table with calculated values using other field values. Is this possible? And example of part of the code is: ... <?php $recnum = 1; foreach ($records as $fmrecord) { $record = new RecordHighlighter($fmrecord, $cgi); $rowclass = ($recnum % 2 == 0) ? "table_row" : "alt_row"; $recid = $record->getRecordId(); $pos = strpos($recid, "RID_!"); if ($pos !== false) { $recid = substr($recid,0,5) . urlencode(substr($recid,strlen("RID_!"))); } ?> <tr class="<?php echo $rowclass ?>"> <td class="browse_cell left"> <?php echo nl2br(str_replace(' ', ' ', $record->getField('NT', 0) ))?> </td> <td class="browse_cell left"> <?php echo nl2br(str_replace(' ', ' ', $record->getField('Track 1', 0) ))?> </td> <td class="browse_cell right"> <?php echo nl2br(str_replace(' ', ' ', $record->getField('Track 2', 0) ))?> ... So what I need is that when it displays the records the value in field “NT” for instance, is a hyperlink that is calculated in "Field X" I am hoping this is easy and I think I have done it before, but my brain isn’t working due to lack of sleep. Help!!! And thanks.
January 15, 201313 yr Solution If that field is on the layout, then something like: <a href="<?php echo $record->getField('FieldX')?>"><?php echo nl2br(str_replace(' ', ' ', $record->getField('NT', 0) ))?></a> Should do the trick (assuming it's a full or relative hyperlink) - might need the , 0 bit as well?
Create an account or sign in to comment