Importing Fragments for the Distributor Application Pages

Published objects are integrated with Liferay’s core frameworks, so you can map page fragments to object entries, such as form fragments and the Collection Display fragment. Here you’ll import pre-configured fragment compositions for use in distributor application pages. However, before you can import the fragments, unzip and update the object id for the provided form container with the ID for the Distributor Application object in your instance.

Preparing the Fragments for Import

  1. Retrieve the ID for the Distributor Application object and save it for later.

    Begin editing the Distributor Application object and copy its ID.

  2. Download and unzip the Distributor Application fragment set:

    curl https://resources.learn.liferay.com/courses/latest/en/application-development/designing-user-interfaces/liferay-b2m3.zip -O
    
    unzip liferay-b2m3.zip
    
  3. Navigate to this folder: liferay-b2m3/fragment-compositions/application-form.

  4. Open the fragment-composition-definition.json file in your code editor.

  5. Enter this value for className, replacing [OBJECT_ID] with the ID of the Distributor Application object: com.liferay.object.model.ObjectDefinition#[OBJECT_ID].

    For example,

    "formReference": {
        "className": "com.liferay.object.model.ObjectDefinition#34844",
        "classType": 0
    }
    
  6. Save the file and zip the fragment set:

    zip distributor-application-fragment-set.zip liferay-b2m3 -r
    

Now you can import the fragment set into your site.

Importing the Fragment Set

  1. Open the Site Menu ( Site Menu ), expand Design, and click Fragments.

  2. Click Actions ( Actions Button ) for Fragment Sets and select Import.

    Click the Actions button for Fragment Sets and click Import.

  3. Select the distributor-application-fragment-set.zip file and click Import.

    Select the distributor-application-fragment-set.zip file and click Import.

  4. Confirm the Distributor Application fragments imported successfully. This set should include three fragments:

    • Form Page
    • Success Page
    • Display Page

    Confirm the Distributor Application fragments imported successfully.

Now that you’ve imported the fragments, you can use them to integrate the Distributor Application object with your pages.

Next: Adding the Form to the Apply Page

Relevant Concepts

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy