Contributed fragment sets are deployable modules containing page fragments. Fragments in a contributed set can be used like regular fragments, but aren’t contained in the database and can’t be modified directly through the UI.
docker run -it -m 8g -p 8080:8080 liferay/portal:7.4.3.132-ga132
Sign in to Liferay at http://localhost:8080. Use the email address test@liferay.com and the password test. When prompted, change the password to learn.
Then, follow these steps to deploy an example to see what a contributed fragment set looks like:
If testing on Windows, you may need to build the module first with ./gradlew build and then manually copy the JAR to docker cp docker-container-name:/opt/liferay/osgi/modules directly if deployment fails.
Confirm the deployment to the Liferay Docker container console. The log message below should appear in the Docker console:
INFO [fileinstall-directory-watcher][BundleStartStopLogger:46] STARTED com.acme.l3m9.impl_1.0.0 [1824]
Verify the contributed fragment set is available. Open the Site Menu () and go to Design → Fragments. The set should appear in the Default Sets list.
Great! You successfully deployed a contributed fragment set.
As you can see, the contributed fragment set appears with the default fragment sets, and the fragments can’t be modified from the UI. The only way to modify the set is to update the module they came from or copy the fragment to another set and modify the fragment copy.
Move the example’s l3m9-impl/l3m9-jumbotron folder into the l3m9-impl/src/main/resources/com/acme/l3m9/internal/fragment/contributor/l3m9/dependencies folder.
Packaged fragments go in the dependencies folder, and the class package name and resources package name must match (e.g. [class.package.path].dependencies).
If deployment fails on Windows, you may need to bind mount Liferay in the container, build the module JAR with .\gradlew jar, and copy the JAR to the appropriate bind-mounted folder.
Verify that the updated fragment is included in the contributed set. Point your browser to https://localhost:8080, and under the Site Menu on the left side of the screen, go to Design → Fragments. The L3M9 Jumbotron Fragment appears in the L3M9 Set.
Congratulations! You now know how to create a contributed fragment set, and have added a new contributed fragment set to Liferay.
This website uses cookies and similar tools, some of which are provided by third parties (together “tools”). These tools enable us and the third parties to access and record certain user-related and activity data and to track your interactions with this website. These tools and the informationcollected are used to operate and secure this website, enhance performance, enable certain website features and functionality, analyze and improve website performance, and personalize user experience.
If you click “Accept All”, you allow the deployment of all these tools and collection of the information by us and the third parties for all these purposes.
If you click “Decline All” your IP address and other information may still be collected but only by tools (including third party tools) that are necessary to operate, secure and enable default website features and functionalities. Review and change your preferences by clicking the “Configurations” at any time.
Visit our Privacy Policy