コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

この会話は、活動がないためロックされています。新しい投稿を作成してください。

解決済み

Bulk Generate page Thumbnails

Avatar

Level 5

Hi @All,
we have a  requirement . we have approx 15,000 pages and for all the pages i need to generate thumbnails
(page properties -> thumbnails -> generate -> save & close)
Is there is any automated way to do this ?

Thanks and regards
Saurabh Kumar
 

1 受け入れられたソリューション

Avatar

正解者
Level 4

Hi @lone_Ranger  Currently Adobe uses PageThumbnail.js(/libs/cq/gui/components/common/wcm/clientlibs/wcm/js/pagethumbnail.js) for the thumbnail generation. Please check the method function generate() that is used for thumbnail generation.

You can use this function to generate the page thumbnails and loop it for all the pages. Please note that this generate only file.sftmp on the jcr that is used to hold temporary assets data in JCR.

元の投稿で解決策を見る

6 返信

Avatar

Level 4

Do you want to apply some specific image as thumbnail ? If yes, you can write custom script for this.

Avatar

Level 5

No i want to generate different Thumbnails for all pages.

Avatar

Community Advisor

Avatar

Level 5

Template thumbnail is already there i want to generate different thumbnails for all page.  

Avatar

Community Advisor

Hi,

Not sure if it can be done from backend as there is no API(I am not aware of any)

But the logic is at client side - http://localhost:4502/libs/cq/gui/components/common/wcm/clientlibs/wcm.js

 

function generate(component) {
        var activator = component.find(".cq-wcm-pagethumbnail-activator").prop("disabled", true);
        wait(component);

        var path = component.data("cqWcmPagethumbnailPath");
        var isTemplate = component.data("isTemplate") || false;
        var dest = isTemplate ? "thumbnail.png.sftmp" : "file.sftmp";

        var pgen = new CQ.Siteadmin.PagePreview();
        pgen.generatePreview(path, dest, isTemplate, function(data) {
            // use attr() instead of prop() for action, so that no domain is appended
            if(isTemplate) {
                setValue(component, "./thumbnail.png@MoveFrom", component.closest("form").attr("action") + "/" + dest);
            } else {
                setValue(component, "./image/file@MoveFrom", component.closest("form").attr("action") + "/image/" + dest);
            }
            clearWait(component, data);
            activator.prop("disabled", false);
        });
    }

 

Arun Patidar

AEM LinksLinkedIn

Avatar

正解者
Level 4

Hi @lone_Ranger  Currently Adobe uses PageThumbnail.js(/libs/cq/gui/components/common/wcm/clientlibs/wcm/js/pagethumbnail.js) for the thumbnail generation. Please check the method function generate() that is used for thumbnail generation.

You can use this function to generate the page thumbnails and loop it for all the pages. Please note that this generate only file.sftmp on the jcr that is used to hold temporary assets data in JCR.