September 4, 201015 yr Filemaker PHP site assistant generates recordlist.php ... <?php echo getSortRecordsLink('Name', 'Name')?> <?php echo getSortRecordsLink('Website', 'Website')?> <?php echo getSortRecordsLink('Email', 'Email')?> I want a single column with the name linked to the website, but if no website exists, linked to the email, and if no email, just the name. The old CDML code was- [FMP-IF: field:Website.cn.http] [FMP-FIELD: Name][FMP-ELSE][FMP-IF: field:Email.cn.@] [FMP-FIELD: Name][FMP-ELSE][FMP-FIELD: Name][/FMP-IF][/FMP-IF] Does anyone have suggestions or a sample php file that does something like this? I don't want to use calculations within Filemaker. Thanks for any help.
September 11, 201015 yr Author This may be clunky, but it appears to work. Suggestions for improving it are welcome. <?php if (nl2br( $record->getField('Instructor website', 0) ) != "" ) { echo " href="" . nl2br( $record->getField('Instructor website', 0) ) . "">" . nl2br( $record->getField('Instructor', 0) ) . "" ; } elseif (nl2br( $record->getField('Instructor email', 0) ) == "" ) { echo nl2br( $record->getField('Instructor', 0) ) ; } else { echo " href="mailto:" . nl2br( $record->getField('Instructor email', 0) ) . "">" . nl2br( $record->getField('Instructor', 0) ) . "" ; } ?>
Create an account or sign in to comment