Computer Reference: Content Builder



  • Category
    Content Builder
  • Title
    Put user values into fields of a ContentBuilder form
  • Description

    It is often the case that the content of a ContentBuilder view depends on values in the current user profile.  

    When editing a form you may place the values of user profile elements into the form by putting lines of code into the "Editable Prepare" tab of the Content Builder view.

    Here is representative syntax for placing a user's name from his profile into a field labeled "Name" in the form being defined:

    $items["Name"]["value"] =JFactory::getUser()->get('name');

    and another putting the user’s email address into a field labeled “Email":

    $items["Email"]["value"] =JFactory::getUser()->get('email');