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
-
Retrieve the ID for the Distributor Application object and save it for later.
-
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
-
Navigate to this folder:
liferay-b2m3/fragment-compositions/application-form
. -
Open the
fragment-composition-definition.json
file in your code editor. -
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 }
-
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
-
Open the Site Menu ( ), expand Design, and click Fragments.
-
Click Actions ( ) for Fragment Sets and select Import.
-
Select the
distributor-application-fragment-set.zip
file and click Import. -
Confirm the Distributor Application fragments imported successfully. This set should include three fragments:
- Form Page
- Success Page
- Display Page
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