getPages
Obtendo todos os objetos de página com informações do produto como um array.
Descrição
Este método recupera todas as páginas criadas como um array da API. Ele retorna uma Promise que resolve para um array de objetos IPagesEntity.
Páginas.getPages(
langCode);
Esquema de parâmetros
Esquema
langCode: string
Código do idioma. Padrão: "en_US"
exemplo: "en_US"
Exemplos
Exemplo mínimo
const response = await Pages.getPages();
Exemplo com atributos
const response = await Pages.getPages('en_US');
Exemplo de resposta
[
{
"id": 10,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "catalog",
"attributeSetIdentifier": "page",
"localizeInfos": {
"title": "Catálogo",
"menuTitle": "Catálogo",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"products": 3,
"childrenCount": 0,
"type": "catalog_page",
"position": 5,
"templateIdentifier": "template",
"isSync": true,
"attributeValues": {
"text": {
"type": "string",
"value": "texto do catálogo",
"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": 8,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "blog",
"attributeSetIdentifier": "page",
"localizeInfos": {
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"products": 0,
"childrenCount": 1,
"type": "common_page",
"position": 3,
"templateIdentifier": "template",
"isSync": true,
"attributeValues": {
"text": {
"type": "string",
"value": "algum texto",
"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": 9,
"config": {},
"depth": 1,
"parentId": 8,
"pageUrl": "blog1",
"attributeSetIdentifier": null,
"localizeInfos": {},
"isVisible": true,
"products": 0,
"childrenCount": 0,
"type": "common_page",
"position": 1,
"templateIdentifier": null,
"isSync": false,
"attributeValues": {}
}
]
Esquema de resposta
Esquema: IPagesEntity[]
id: number
O identificador do objeto.
exemplo: 8
parentId: number | null
O id da página pai, se contiver null, então é a página de nível superior.
exemplo: 10
pageUrl: string
URL única da página.
exemplo: "blog"
depth: number
Profundidade de aninhamento da página em relação ao parentId.
exemplo: 10
localizeInfos: ILocalizeInfo
O nome da página, levando em conta a localização.
exemplo:
{
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
}
isVisible: boolean
Um sinal de visibilidade da página.
exemplo: true
type: Types
Tipo de página.
exemplo:
"common_page"
templateIdentifier: string | null
Id do usuário do template vinculado.
exemplo: "template"
attributeSetIdentifier: string | null
Id do conjunto de atributos.
exemplo: "page"
attributeValues: AttributeType
Array de valores de atributos do índice (representados como um par de id de atributo do usuário: valor do atributo).
exemplo:
{
"text": {
"type": "string",
"value": "algum texto",
"position": 0,
"additionalFields": []
}
}
isSync: boolean
Indicação de indexação da página.
exemplo: true
template: any
Objeto template.
position: number
Número do item (para ordenação).
exemplo: 2
config: any
Configurações de saída para páginas de catálogo.
exemplo:
{
"rowsPerPage": 1,
"productsPerRow": 1
}
products: number
O número de produtos vinculados à página.
exemplo: 0
childrenCount: number
Contagem de filhos.
exemplo: 1