title | description | type | stub | service | i18nReady |
---|---|---|---|---|---|
Crystallize & Astro |
Crystallize를 CMS로 사용하여 Astro 프로젝트에 콘텐츠 추가 |
cms |
true |
Crystallize |
false |
Crystallize는 GraphQL API를 노출하는 전자상거래용 헤드리스 콘텐츠 관리 시스템입니다.
---
// Crystallize GraphQL API에서 카탈로그 경로를 가져옵니다.
import BaseLayout from '../../layouts/BaseLayout.astro';
import { createClient } from '@crystallize/js-api-client';
const apiClient = createClient({
tenantIdentifier: 'furniture'
});
const query = `
query getCataloguePaths{
catalogue(language: "en", path: "/shop") {
name
children {
name
path
}
}
}
`
const { data: { catalogue } } = await apiClient.catalogueApi(query)
---
<BaseLayout>
<h1>{catalogue.name}</h1>
<nav>
<ul>
{catalogue.children.map(child => (
<li><a href={child.path}>{child.name}</a></li>
))}
</ul>
</nav>
</BaseLayout>