Prezeráte obsah pomocníka verzie:

Introduction

This section of the documentation describes how to add client-side libraries (clientlibs) to a page for Communities components.

For basic information, visit :

Why Clientlibs are Required

Clientlibs are required for the proper functioning (JavaScript) and styling (CSS) of a component.

When there exists a community function for a feature, all necessary components and configurations, including the required clientlibs, will be present in the community site.  Only if additional components are to be available to authors would additonal clientlibs need to be added.

When the required clientlibs are missing, adding a Communities component to a page could result in javascript errors as well as an unexpected appearance.

Example : Placed Reviews without Clientlibs

chlImage_1

Example : Placed Reviews with Clientlibs

chlImage_1

Identifying Required Clientlibs

The essential feature information for developers identifies the required clientlibs.

In addition, from an AEM instance, browsing to the Community Components Guide provides access to a listing of clientlib categories required for a component.

For example, at the very top of the Reviews page the required clientlibs listed are

  • cq.ckeditor
  • cq.social.hbs.reviews
chlImage_1

Adding Required Clientlibs

When it is desired to add a Communities component to a page, it will be necessary to add the required clientlibs for the component if not already present.

Use CRXDE|Lite to modify an existing clientlibslist for a community site page.

To add a clientlib for a community site using CRXDE Lite :

  • browse to http://<server>:<port>/crx/de
  • locate the clientlibslist node for the page on which you wish to add the component
    • /content/sites/sample/en/page/jcr:content/clientlibslist
  • with clientlibslist node selected
    • locate the String[] property scg:requiredClientLibs
    • select its Value to access the String array dialog
      • scroll down if necessary
      • select + to enter a new client library
        • repeat to add more client libraries
      • select OK
    • select Save All

Poznámka:

If the site is not a community site, the existance or location of the client libraries in use for the site would need to be discovered.

Using the Getting Started with AEM Communities example, where site-name is engage, this is how the clientliblist would appear if adding the reviews component :

chlImage_1

Licencia na používanie tohto diela sa poskytuje v súlade s podmienkami licencie Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Na príspevky v sociálnych sieťach Twitter™ a Facebook sa nevzťahujú podmienky licencií Creative Commons.

Právne upozornenia   |   Zásady ochrany osobných údajov online