Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Record list with single column using if statements

Featured Replies

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.

  • 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

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.