Fragments Toolkit Command Reference

Note

The Fragments Toolkit is deprecated as of Liferay 2024.Q1+/Portal 7.4 GA112+. See Alternatives for the Fragments Toolkit for more information.

The Fragments Toolkit can connect to your currently running Liferay DXP instance to import and export fragments. You can even have Fragments that you create with the toolkit imported into Portal automatically. These commands are available:

CommandDescription
npm run add-collectionCreate a new collection to organize fragments. Referred as Fragment Sets in the platform.
npm run add-fragmentAdd a component, input, or React fragment to a new or existing collection.
npm run add-fragment-compositionAdd a new fragment composition to a new or existing collection.
npm run add-page-templateCreate a new display page template, page template, or master page.
npm run buildCompile .sass or .scss file specified in fragment.json’s cssPath key, storing the compiled CSS code in build/liferay-fragments. Only compiled CSS is stored and no SCSS is saved in the database. External fragments should be stored in an external repository.
npm run compressCreate a .zip file that can be manually imported into Portal. To use this in Liferay PaaS, you must configure the JVM.
npm run exportGet collections and fragments from a running server.
npm run importSend the collections and fragments from your current project to a running server. If your Fragment’s configuration JSON (if available) is invalid, the import fails and provides an error message.
npm run import:watchAutomatically import Collections and Fragments into Portal as they are created or modified.
npm run previewLiferay DXP 7.2 SP1+/Portal 7.2 GA2+ Preview a Fragment before importing. Changes made to the fragment are auto-reloaded to display updates. This feature requires the installation of the OAuth 2 plugin in your portal instance.
Note

You can see all of the available tasks inside the scripts section in the Fragment Set project’s package.json.

With these tools at your disposal, you can efficiently manage creating and editing Page Fragments from the command line in your local environment.

Capabilities

Product

Contact Us

Connect

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