getPages
Lấy tất cả các đối tượng trang với thông tin sản phẩm dưới dạng một mảng.
Pages?.getPages( langCode? );
Ví dụ tối thiểu
const value = await Pages.getPages();
Schema
langCode: string
Mã ngôn ngữ. Mặc định: "en_US"
ví dụ: "en_US"
Phương thức này lấy tất cả các trang đã tạo dưới dạng một mảng từ API. Nó trả về một Promise mà khi hoàn thành sẽ trả về một mảng các đối tượng hoặc một mảng rỗng [] nếu không có dữ liệu.
Ví dụ phản hồi
[
{
"id": 9,
"config": {},
"depth": 1,
"parentId": 8,
"pageUrl": "blog1",
"attributeSetIdentifier": null,
"localizeInfos": {
"title": "Blog 1",
"menuTitle": "Blog 1",
"htmlContent": "",
"plainContent": ""
},
"position": 1,
"isVisible": true,
"products": 0,
"childrenCount": 0,
"type": "common_page",
"templateIdentifier": null,
"isSync": false,
"attributeValues": {}
},
{
"id": 8,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "blog",
"attributeSetIdentifier": "page",
"localizeInfos": {
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
},
"position": 2,
"isVisible": true,
"products": 0,
"childrenCount": 1,
"type": "common_page",
"templateIdentifier": "template",
"isSync": true,
"attributeValues": {
"text": {
"type": "string",
"value": "some text",
"position": 0,
"additionalFields": []
},
"number": {
"type": "integer",
"value": 0,
"position": 1,
"additionalFields": []
},
"real": {
"type": "real",
"value": "",
"position": 2,
"additionalFields": []
},
"float": {
"type": "float",
"value": 0,
"position": 3,
"additionalFields": []
}
},
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "Template",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
},
{
"id": 10,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "catalog",
"attributeSetIdentifier": "page",
"localizeInfos": {
"title": "Catalog",
"menuTitle": "Catalog",
"htmlContent": "",
"plainContent": ""
},
"position": 3,
"isVisible": true,
"products": 3,
"childrenCount": 0,
"type": "catalog_page",
"templateIdentifier": "template",
"isSync": true,
"attributeValues": {
"text": {
"type": "string",
"value": "catalog text",
"position": 0,
"additionalFields": []
},
"number": {
"type": "integer",
"value": 0,
"position": 1,
"additionalFields": []
},
"real": {
"type": "real",
"value": "",
"position": 2,
"additionalFields": []
},
"float": {
"type": "float",
"value": 0,
"position": 3,
"additionalFields": []
}
},
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "Template",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
}
]
Schema
id: number
Định danh của đối tượng.
ví dụ: 8
parentId: number | null
Id của trang cha, nếu nó chứa null, thì đó là trang cấp cao nhất.
ví dụ: 10
pageUrl: string
Url trang duy nhất.
ví dụ: "blog"
depth: number
Độ sâu lồng ghép của trang so với parentId.
ví dụ: 10
localizeInfos: ILocalizeInfo
Tên của trang, tính đến việc địa phương hóa.
ví dụ:
{
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
}
isVisible: boolean
Một dấu hiệu về tính khả thi của trang.
ví dụ: true
type: Types
Loại trang.
ví dụ:
"common_page"
templateIdentifier: string | null
Id người dùng của mẫu liên kết.
ví dụ: "template"
attributeSetIdentifier: string | null
Tập hợp các id thuộc tính.
ví dụ: "page"
attributeValues: AttributeType
Mảng các giá trị thuộc tính từ chỉ mục (được biểu diễn dưới dạng cặp id thuộc tính người dùng: giá trị thuộc tính).
ví dụ:
{
"text": {
"type": "string",
"value": "some text",
"position": 0,
"additionalFields": []
}
}
isSync: boolean
Chỉ định về việc lập chỉ mục trang.
ví dụ: true
template: any
Đối tượng mẫu.
position: number
Số thứ tự mục (để sắp xếp).
ví dụ: 2
config: any
Cài đặt đầu ra cho các trang danh mục.
ví dụ:
{
"rowsPerPage": 1,
"productsPerRow": 1
}
products: number
Số lượng sản phẩm liên kết với trang.
ví dụ: 0
childrenCount: number
Số lượng trẻ em.
ví dụ: 1