@shopware-pwa/cms-base
TypeScript icon, indicating that this package has built-in type declarations

0.9.1 • Public • Published

shopware/frontends - cms-base

Nuxt module that provides an implementation of all CMS components in Shopware based on utility-classes using unocss/Tailwind.css syntax.

It is useful for projects that want to use the CMS components but design their own layout.

Features

Setup

Install npm package:

# Using pnpm
pnpm add -D @shopware-pwa/cms-base

# Using yarn
yarn add --dev @shopware-pwa/cms-base

# Using npm
npm i @shopware-pwa/cms-base --save-dev

Then, register the module by editing nuxt.config.js or (.ts) file:

/* nuxt.config.ts */

export default defineNuxtConfig({
  /* ... */
+ modules: [/* ... */, "@shopware-pwa/cms-base"],
});

⚠️ <RouterLink/> components used

Some components use RouterLink component internally, available in Vue Router. In order to parse CMS components correctly and avoid missing component warning, it's highly recommended to have Vue Router installed or Nuxt router enabled in your application.

Basic usage

Since all CMS components are registered in your Nuxt application, you can now start using them in your template (no imports needed):

/* Vue component */

// response object can be a Product|Category|Landing Page response from Shopware 6 store-api containing a layout (cmsPage object) built using  Shopping Experiences
<template>
    <CmsPage v-if="response.cmsPage" :content="response.cmsPage"/>
</template>

You can use default styling by installing/importing Tailwind CSS stylesheet in your project.

See a short guide how to use cms-base package in your project based on Nuxt v3.

TypeScript support

All components are fully typed with TypeScript.

No additional packages needed to be installed.

Links

Changelog

Full changelog for stable version is available here

Latest changes: 0.9.1

Patch Changes

  • #460 729d03a5 Thanks @mkucmus! - Apply visibility and css classes for CMS layout

  • Updated dependencies [729d03a5, c3aa09ee, 0e031efe]:

    • @shopware-pwa/helpers-next@0.5.1
    • @shopware-pwa/composables-next@0.14.1
    • @shopware-pwa/api-client@0.7.0

Dependencies (8)

Dev Dependencies (10)

Package Sidebar

Install

npm i @shopware-pwa/cms-base

Weekly Downloads

1,476

Version

0.9.1

License

MIT

Unpacked Size

169 kB

Total Files

98

Last publish

Collaborators

  • patzick
  • mkucmus