Vizualizați conținut de ajutor pentru versiunea:

The Community Components guide is an interactive development tool for the social component framework (SCF).  It provides a list of available AEM Communities components or the more complex features built of multiple components.

Along with basic information for each component, the guide allows for experimentation with how the SCF components/features work and how they can be configured or customized.

For information regarding development essentials related to each component, see Feature and Component Essentials.

Getting Started

The guide is intended for use on development installations of author (localhost:4502) and publish (localhost:4503) instances.

The Community Components site is accessed by browsing to

Interactions with the Communities components will vary depending on :

  • the server (author or publish)
  • whether or not the site visitor is signed in
  • if signed in, the privileges assigned to the member
  • whether or not the default SRP, JSRP, is in use

On author, to enter edit mode, insert either editor.html or cf# as the first path segment after the server name : 

Notă:

On author, when using the touch-optimized UI in Edit mode, the links on a page are not active.

To navigate to a component page, first select Preview mode to activate the links.

With the component page displayed in the browser, return to Edit mode in order to open the component's edit dialog.

For general authoring information, view the quick guide to authoring pages.

If not familiar with the touch-optimized UI, view the documentation on basic handling.

Home Page

The guide provides a listing of SCF components available for preview and prototyping along the left side of the page.

Components Guide as viewed on an author instance in Edit mode :

chlimage_1

Component Pages

Select a component from the list along the left side of the page.  

chlimage_1

The main body of the guide displays :

  1. Title : the name of the component selected
  2. Client-Side Llibraries : a list of one or more required categories
  3. Includable : if the component may be dynamically included, then the state can be toggled in author edit mode : 
    • if added, text displayed is      : "This component is included via its par node."
    • if included, text displayed is   : "This component is included dynamically."
    • if not includable, then no text is displayed
  4. Sample Component or Feature : an active instance of the component or feature.  If a component, it may be altered with changes made to the templates, CSS and data provided in the tab section.

Notă:

After making a selection from the left-hand side, the component will appear below, instead of beside, the listing of components when the browser window is too narrow.

Author Interactions

When using the guide on an author instance, it is possible to experience configuring a component by opening its dialog.  Information for developers is provided in the Component and Feature Essentials section of the documentation, while the dialog settings are described in Communities Components section for authors.

For the Community Components guide, some component dialog settings are overlayed with the Includable toggle state.  To toggle between using the existing resource or a dynamically included resource, in edit mode select both the component and includable text and double-click to open the edit dialog :

chlimage_1

Under the Templates tab :

chlimage_1
  • Include the child component with sling:include

    If unchecked, the Component Guide will use the existing resource in the repository (a jcr node which is a child of a par node).
    • text displayed is  : "This component is included via its par node."

    If checked, the Component Guide will use sling to dynamically include a component of the child node's resourceType (non-existing resource).
    • text displayed is  : "This component is included dynamically."

    Default is unchecked.

Publish Interactions

When using the guide on a publish instance, it is possible to experience the components and features as a site visitor (not signed in) and as members with various privileges when signed in.

Notă:

Be aware, if the SRP is left defaulted to JSRP, then UGC entered on the publish instance will only be visible on publish, and will not be visible from the moderation console on the author instance.

Client-Side Libraries

The client-side libraries (clientlibs) listed for each component are those required to be referenced when the component is placed on a page.  The clientlibs provide a means of managing and optimizing the download of the Javascript and CSS used to render the component in the browser.

For more information, visit Clientlibs for Communities Components.

Impersonation

On the author instance, where one is often signed in as an administrator or developer, in order to experience the component logged in as another user, use the text box to the left of the Impersonate button to either type in the username or select from the pull down list, and then click the button.  Click Revert to signout and end the impersonation.

The publish instance does not need to impersonate.  Simply use the Login/Logout link to impersonate various users, such as the demo users.

Customization

When enabled, each SCF component is available for prototyping of possible customizations by temporarily modifying the component's template, CSS and data.

Enabling Customization

Notă:

This tool is read-only.  None of the edits made to templates, CSS or data are saved to the repository.

To quickly experiment with customizations, the scg:showIde property must be added to the component page's content JCR node and set to true.

Using the comments component as an example, on either the author or publish instance, signed in with administrator privileges :

  1. browse to CRXDE Lite
    for example, http://localhost:4503/crx/de
  2. select the component's jcr:content node
    for example, /content/community-components/en/comments/jcr:content
  3. add a property
    • Name  scg:showIde
    • Type   String
    • Value  true
  4. select Save All
  5. reload the Comments page in the guide
    http://localhost:4503/content/community-components/en/comments.html
  6. notice there are now 3 tabs for Templates, CSS, and Data.
chlimage_1
chlimage_1

Templates Tab

Select the templates tab to see the templates associated with the component.

The Template Editor allows local edits to be compiled and applied to the sample component instance at the top of the page without affecting the component in the repository.  

Running compile on local edits will highlight any errors along by placing a dot in the gutter and marking the text red. 

CSS Tab

Select the CSS tab to see the CSS associated with the component.

If a component is a composite of multiple components, some CSS may be listed under one of the other components.

The CSS Editor allows the CSS to be modified and applied to the sample component instance at the top of the page.  

A rule may be selected to highlight the parts of the DOM using that rule by clicking next to the rule in the gutter.

Data Tab

Select the Data tab to show the .social.json endpoint data. This data is editable and is applied to the sample component instance. 

Syntax errors may be marked in the gutter as well as highlighted in the editor.

Această lucrare este oferită sub licență Atribuire-Necomercial-FărăModificări 3.0 Ne-adaptată Creative Commons  Postările pe Twitter™ şi Facebook nu sunt acoperite de condiţiile de licenţiere Creative Commons.

Prevederi legale   |   Politică de confidențialitate online