SHOW THE FULL NAME OF THE AUTHOR ON A WEB PAGE - Jul 21st, 2011


In earlier versions it used to be a pretty involved process to display the author’s name in a listing. Now it’s as
simple as adding one line of code to the body of your page where you want the Full Name to appear.

For a list page, just add:



<?php echo $record['createdBy.fullname'] ?>

In the foreach loop.

And for a detail page, it’s:



<?php echo $yourtableRecord['createdBy.fullname'] ?>

According to Dave Edis:

It loads the record of the "owner" from createdByUserNum and adds all those fields with a "createdBy." prefix.

If, like me you need to have a Last Name and a First Name for sorting and display purposes, you can add the 2 fields
"first_name" and" last_name" to the "User Accounts" editor and then modify the createdBy code to:



<?php echo $record['createdBy.first_name'] ?>&nbsp;<?php echo $record['createdBy.last_name'] ?>



or



<?php echo $yourtableRecord['createdBy.first_name'] ?>&nbsp;<?php echo $yourtableRecord['createdBy.last_name'] ?>



You can now display and sort your "User Account" record list by the new "last name" and "first_name" fields and even
delete the "fullname" field from the "User Accounts" table if you don't feel you will ever need it for anything. Just
don't forget to enter the new information before you delete the "fullname" field.

NOTE: You can also use this technique in the LisPage fields that show at the top of your records lists in a multi-record
editor to show the author's name instead of the createdByUserNum



The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service