category

Craft 3.4 Changelog:アセットを複数まとめてダウンロードする #craftcms

2020-02-06

Craft 3.4 の Changelog を見てみるシリーズ。

It’s now possible to download multiple assets at once as a zip file. (#5259)

ということで、アセットの複数ダウンロードを試してみる。

アセットの一覧画面。

複数チェックを入れる。

エクスポートのところは先日の話のような感じのメニュー。

トグルをクリックすると、メニューの中にダウンロードがある。

ダウンロードしたファイルを解凍するとこんな感じ。

ダウンロード機能が必要になったりする時にも便利そう。

3.3 での複数ファイルのダウンロード

3.3の時は1つのファイルであればダウンロードできる。

複数チェックが入っていると無効になる。

アセットのエクスポート

エクスポートの方からエクスポートするとこんな感じのJSONが取れた

[
    {
        "volumeId": "1",
        "folderId": "1",
        "uploaderId": "1",
        "folderPath": "",
        "filename": "mersynote.html",
        "kind": "html",
        "size": "32094",
        "keptFile": null,
        "dateModified": "2020-01-29T09:57:50+09:00",
        "newLocation": null,
        "locationError": null,
        "newFilename": null,
        "newFolderId": null,
        "tempFilePath": null,
        "avoidFilenameConflicts": false,
        "suggestedFilename": null,
        "conflictingFilename": null,
        "deletedWithVolume": false,
        "keepFileOnDelete": false,
        "id": "32",
        "tempId": null,
        "draftId": null,
        "revisionId": null,
        "uid": "cee7af04-f192-4aec-9e8f-31240c5ed245",
        "fieldLayoutId": null,
        "contentId": "15",
        "enabled": "1",
        "archived": "0",
        "siteId": "1",
        "title": "Mersynote",
        "slug": null,
        "uri": null,
        "dateCreated": "2020-01-29T09:57:50+09:00",
        "dateUpdated": "2020-01-29T09:57:50+09:00",
        "dateDeleted": null,
        "trashed": false,
        "propagateAll": false,
        "newSiteIds": [],
        "resaving": false,
        "duplicateOf": null,
        "previewing": false,
        "hardDelete": false,
        "ref": null,
        "status": "enabled",
        "structureId": null,
        "url": "http://example.com/asset/mersynote.html",
        "extension": "html",
        "focalPoint": null,
        "hasFocalPoint": false,
        "height": null,
        "mimeType": "text/html",
        "path": "mersynote.html",
        "width": null,
        "sampleMatrix": [],
        "sampleRadio": null
    },
〜〜以下略〜〜
]

なるほどなるほど。