Pular para o conteúdo principal

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 ou um array vazio [] se não houver dados.

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": 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": "Catálogo",
"menuTitle": "Catálogo",
"htmlContent": "",
"plainContent": ""
},
"position": 3,
"isVisible": true,
"products": 3,
"childrenCount": 0,
"type": "catalog_page",
"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
}
}
]

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 consideração 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 (representado como um par de id de atributo do usuário: valor do atributo).
exemplo:

{
"text": {
"type": "string",
"value": "some text",
"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