Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Extensible page component written in HTL.
* Blueprints and live copy
* Closed user groups and permissions
* Cloud services
* Structured Data (JSON-LD) injection in the page head

## Loading of CSS/JS
The page component automatically loads certain client libraries in the head section and at the end of the body section
Expand Down Expand Up @@ -77,6 +78,7 @@ media
20. `./cq:contextHubPath` - defines the Context Path configuration used by this page.
21. `./cq:contextHubSegmentsPath` - defines the Context Path Segments Path.
22. `./id` - defines the component HTML ID attribute.
23. `./cq:structuredData` - defines a list of JSON-LD blocks rendered as `<script type="application/ld+json">` tags in the page `<head>`.

## Client Libraries
The component provides a `core.wcm.components.page.v1.sharing` client library category that contains the JavaScript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Extensible page component written in HTL.
* Closed user groups and permissions
* Cloud services
* [PWA support](https://experienceleague.adobe.com/docs/experience-manager-cloud-service/sites/authoring/features/enable-pwa.html)
* Structured Data (JSON-LD) injection in the page head

## Loading of CSS/JS
The page component automatically loads certain client libraries in the head section and at the end of the body section
Expand Down Expand Up @@ -103,6 +104,7 @@ media
21. `./cq:contextHubSegmentsPath` - defines the Context Path Segments Path.
22. `./mainContentSelector` - defines the ID of the main content element of the page (used by the "skip to main content" accessibility feature).
23. `./id` - defines the component HTML ID attribute.
24. `./cq:structuredData` - defines a list of JSON-LD blocks rendered as `<script type="application/ld+json">` tags in the page `<head>`.

## Web Resources Client Library
A web resources client library can be defined at the template level (see `./appResourcesClientlib` component policy configuration).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Extensible page component written in HTL.
* Closed user groups and permissions
* Cloud services
* [PWA support](https://experienceleague.adobe.com/docs/experience-manager-cloud-service/sites/authoring/features/enable-pwa.html)
* Structured Data (JSON-LD) injection in the page head

## Loading of CSS/JS
The page component automatically loads certain client libraries in the head section and at the end of the body section
Expand Down Expand Up @@ -103,6 +104,7 @@ The following properties are written to JCR for this Page component and are expe
22. `./cq:featuredimage/fileReference` property or `./cq:featuredimage/file` child node - will store either a reference to the image file, or the image file of the featured image of the page.
23. `./cq:featuredimage/alt` - defines the value of the HTML `alt` attribute of the featured image of the page.
24. `./cq:featuredimage/altValueFromDAM` - if `true`, the HTML `alt` attribute of the featured image of the page is inherited from the DAM asset.
25. `./cq:structuredData` - defines a list of JSON-LD blocks rendered as `<script type="application/ld+json">` tags in the page `<head>`.

## Web Resources Client Library
A web resources client library can be defined at the template level (see `./appResourcesClientlib` component policy configuration).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.adobe.cq.testing.junit.assertion.GraniteAssert;
import com.adobe.cq.testing.junit.rules.CQAuthorPublishClassRule;
import com.adobe.cq.testing.junit.rules.CQRule;
import com.adobe.cq.testing.junit.rules.toggles.RunIfToggleEnabled;

public class PageIT {

Expand Down Expand Up @@ -79,4 +80,13 @@ public void testIsClientlibsAsync() throws ClientException {
GraniteAssert.assertRegExFind(message, content, pattern);
}

@Test
@RunIfToggleEnabled("FT_SITES-42542")
public void testStructuredData() throws ClientException {
String message = "The page head should contain the JSON-LD script tag for the cq:structuredData block";
String content = adminAuthor.doGet("/content/core-components/simple-page/simple-page-v3.html", 200).getContent();
Pattern pattern = Pattern.compile("<script type=\"application/ld\\+json\">\\{\"@context\":\"https://schema\\.org\",\"@type\":\"Organization\",\"name\":\"Acme\"}</script>");
GraniteAssert.assertRegExFind(message, content, pattern);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<jcr:content
cq:lastModified="{Date}2022-02-28T21:41:13.599+01:00"
cq:lastModifiedBy="admin"
cq:structuredData="[{&quot;@context&quot;:&quot;https://schema.org&quot;\,&quot;@type&quot;:&quot;Organization&quot;\,&quot;name&quot;:&quot;Acme&quot;}]"
cq:template="/conf/core-components/settings/wcm/templates/simple-template-v3"
jcr:primaryType="cq:PageContent"
jcr:title="Simple Page V3"
Expand Down
Loading