Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Retrieve thumbnail URL from page properties in AEM 6.4 using sightly

Avatar

Avatar
Validate 1
Level 1
irmantasluk
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
irmantasluk
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile
irmantasluk
Level 1

28-08-2020

Is it possible to insert thumbnail image URL from page properties of Thumbnail tab into og:image inside meta tag. I am able to get values of pageTitle and description properties but not the image. Or is there a better way to handle this?

<meta property="og:url" content="${head.pagePath}" />
<meta property="og:title" content="${properties.pageTitle}" />
<meta property="og:description" content="${properties['jcr:description']}" />
<meta property="og:image" content="imageURL" />
image page properties sightly thumbnail

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 1
irmantasluk
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
irmantasluk
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile
irmantasluk
Level 1

31-08-2020

Thank you all for your replies. I studied Social Sharing core component source code for a bit and ended up re-using getThumbnail() method to get page thumbnail reference and that worked out as expected.

Answers (4)

Answers (4)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,272 likes

Total Posts

3,151 posts

Correct Reply

887 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,272 likes

Total Posts

3,151 posts

Correct Reply

887 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

31-08-2020

Thumbnail are generated either from template(DAM or browsed image) or uploading direct on page. If you have thumbnail reference from DAM then you can see a property in page otherwise you need to read from local but you can't use that in og tags.

 

 

Avatar

Avatar
Validate 25
MVP
Singaiah_Chintalapudi
MVP

Likes

130 likes

Total Posts

233 posts

Correct Reply

37 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
MVP
Singaiah_Chintalapudi
MVP

Likes

130 likes

Total Posts

233 posts

Correct Reply

37 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
Singaiah_Chintalapudi
MVP

30-08-2020

It depends on your customization (Static/Editable templates). If you're not customizing anything then it would store here:/content/yourpagepath/jcr:content/image. If you look at the property of fileReference then you'll the image ref path. You'll have to use Server Side script (JavaScript API) or use Java to read this and inject back to HTL/HTML.

Avatar

Avatar
Validate 1
MVP
Nikhil-Kumar
MVP

Likes

240 likes

Total Posts

253 posts

Correct Reply

38 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
MVP
Nikhil-Kumar
MVP

Likes

240 likes

Total Posts

253 posts

Correct Reply

38 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile
Nikhil-Kumar
MVP

28-08-2020

@irmantasluk 


Try reading it through node props.

 

Avatar

Avatar
Ignite 1
MVP
Varun_Shakya
MVP

Likes

105 likes

Total Posts

82 posts

Correct Reply

20 solutions
Top badges earned
Ignite 1
Give Back 5
Give Back 3
Give Back
Boost 50
View profile

Avatar
Ignite 1
MVP
Varun_Shakya
MVP

Likes

105 likes

Total Posts

82 posts

Correct Reply

20 solutions
Top badges earned
Ignite 1
Give Back 5
Give Back 3
Give Back
Boost 50
View profile
Varun_Shakya
MVP

28-08-2020

if the thumbnail image is coming from DAM ,then the page have "image" node in jcr:content of page and that image node will be having fileReference property which will have your image path of thumbnail. In this case you can make use of resource object and get the child node image and then get the property(fileReference).

 

If the thumbnail has been uploaded from file system in template. In that case it will not be easy to get.i would say take thumbnail from DAM.