Enabling the Emulator
The Project Archetype and the Standard Site Template are already enabled to use the emulator. If you have developed your own content not based on the Core Components or archetype, please see the document Responsive Design for details on how to develop your components while leveraging these features.
Activate Layout Mode for your Site
Layout mode allows you to use the emulator to adjust the layout of your content for different devices. The WKND sample site is already enabled for Layout mode. Follow these steps to enable your own site.
Configure Breakpoints
Breakpoints are vital to responsive design and define how and when content is adjusted to the target device. However, be cautious since each breakpoint you introduce will generate additional work for your authors to accommodate the content. Many times, two breakpoints can be sufficient, including the default breakpoint which is always there. Adobe recommends not to create more than three breakpoints including the default, i.e. not more than two nodes below cq:responsive/breakpoint
.
-
Breakpoints have a title and a width:
- The title describes the generic device grouping, with orientation if necessary.
- For example,
phone
,tablet
- For example,
- The width defines the maximum width in pixels for that generic device grouping.
- For example, if the breakpoint phone has a width of 768 then that it the maximum width of the layout used for a phone device.
- The title describes the generic device grouping, with orientation if necessary.
-
Breakpoints can be defined:
- On the page template, from where the settings are copied to any pages created with that template.
- On the page node, from where the settings are inherited by any child pages.
-
Breakpoints are visible as markers at the top of the page editor when you are using the emulator.
-
Breakpoints are inherited from the parent node hierarchy and can be overridden at will.
-
There is a default (out-of-the-box) breakpoint which covers everything above the last configured breakpoint.
-
Breakpoints can be defined using CRXDE Lite or XML.
Breakpoints should be considered for both new and existing projects.
-
If you are setting up a new project, you should add breakpoints to the templates.
-
If you are migrating an existing project (with existing content), you must:
- Add breakpoints to the templates.
- Add the same breakpoints to the existing pages.
Because of inheritance you only have to do this for the root page of your content.
Configuring Breakpoints using CRXDE Lite
-
Using CRXDE Lite, navigate to either:
- Your template definition.
- The
jcr:content
node of your page.
-
Under
jcr:content
create the node:- Name:
cq:responsive
- Type:
nt:unstructured
- Name:
-
Under this create the node:
- Name:
breakpoints
- Type:
nt:unstructured
- Name:
-
Under the breakpoints node you can create any number of breakpoints. Each definition is a single node with the following properties:
- Name:
<descriptive name>
- Type:
nt:unstructured
- Title:
String <descriptive title seen in Emulator>
- Width:
Decimal <value of breakpoint>
- Name:
Configuring Breakpoints using XML
Breakpoints are located inside the <jcr:content>
section of the .context.html
under the appropriate template (or content) folder.
An example definition:
<cq:responsive jcr:primaryType="nt:unstructured">
<breakpoints jcr:primaryType="nt:unstructured">
<phone jcr:primaryType="nt:unstructured" title="{String}Phone" width="{Decimal}768"/>
<tablet jcr:primaryType="nt:unstructured" title="{String}Tablet" width="{Decimal}1200"/>
</breakpoints>
</cq:responsive>