Basics of Strapi
Understanding the Strapi architecture
In Strapi there are two main areas responsible for managing and structuring content: the Content Manager and the Content-Type Builder. These areas complement each other and together provide a powerful toolset for content management and design.Content-Type Builder & Content Manager
Content-Type Builder: defining structures and components
This area is used to define the structures in which content will later be entered. Here you define which fields and data types the content should have, and you create the components that will then be filled in the Content Manager.- Define structures: The Content-Type Builder is used to create and edit the schemas for collections and single entries. These schemas determine which data fields and data types are available and what the input masks in the Content Manager look like.
- Design components: Another important function of the Content-Type Builder is to create reusable components. These components can be used in different parts of the project, thereby promoting consistency and reusability in development.
Content Manager: managing content
Here the content created and maintained in a Strapi project is managed directly. This is where users actually add content such as texts, images, and other media that are displayed on the storefront.- Manage content: In the Content Manager, all content such as texts, images, videos, and other media that are visible directly on the storefront is managed. Users can create new content here, edit existing content, or delete content that is no longer needed.
- Organize data: The Content Manager enables systematic organization of content in collections and single entries. This structure helps make content easier to find and manage and supports a clear hierarchy and order within the system.
Interaction of Content Manager and Content-Type Builder
The Content Manager and the Content-Type Builder work hand in hand:- From the builder to the manager: Structures and components created in the Content-Type Builder serve as the basis for content management in the Content Manager. This ensures coherent data handling and efficient content management.
- Adaptability and dynamics: Due to the flexible structure of the Content-Type Builder, adjustments can be made that are then reflected in the Content Manager without content being lost or having to be cumbersomely recreated.
Collections, single entries, and components
Collections
Collections in Strapi are structures that serve to manage several similar pieces of data under one roof. They are well suited for organizing content pages, multiple job listings, or even blog articles. A collection thus acts as a central point under which similar content or elements can be subordinated. Collections are available both under the Content Manager and the Content-Type Builder. More information about collections is available here.Single entries
Single entries are specific content elements that are not necessarily part of a repeatable collection. They can be used for special pages or specific content blocks, such as a banner or a product slider on the home page. Single entries are available both under the Content Manager and the Content-Type Builder. More information about single entries is available here.Content types for creating new collections & single entries
Content types are the building blocks for structuring content within Strapi. They define how data is organized in collections and single entries. New content types and thus new content under collections and single entries are created in the Content-Type Builder.To create new content types, support from a WEBSALE employee from system administration is required. They have to enter the new content types in the configuration of the Strapi connector.
Components
Components in Strapi are reusable building blocks that can be used in different parts of the project to design content consistently and efficiently. More information about components is available here.SEO meta data for CMS pages (meta info plugin)
For CMS pages, the meta info plugin is available by default. It is present on every CMS page and provides fixed, predefined fields there for the SEO details: SEO URL, meta title, meta description, and robots. These fields do not have to be created by you. They are not part of the freely designable content types but are managed by the plugin. As a result, they are present identically on every page and cannot be accidentally changed or deleted while editing content types. This ensures that every page created in Strapi reliably has an SEO URL and can be accessed via it. The values entered are passed on to the shop. The shop sets the meta title and meta description via the same internal mechanism as for category and product pages. They are therefore available in the template as usual via the functions $wsViews.metaTitle() and $wsViews.metaDescription(). In the template, all robots details appear collected under $wsViews.current.robotOptions. Further information:- The meaning of the individual SEO fields is described under Components & collections in Strapi in the section “Meta information”.
- Maintaining the meta information per page is illustrated with examples under Editing content in Strapi.
- How the shop turns these details into an accessible page is described in the next section.
Delivery of CMS pages to the shop
Static content pages (for example terms and conditions, legal notice, payment methods, “About us”) are maintained in Strapi and transferred to the shop as JSON documents. The shop registers its own SEO URLs for them and renders all these pages with one template.The SEO URL generator
SEO URLs are not created when a page is called, but in a separate process. The SEO URL generator (programseogenerator) iterates over the resources of a subshop and writes an SEO URL for each of them into the shop’s URL inventory. It is not CMS-specific. The same mechanism also registers the URLs of products and categories. Each subshop is processed separately.
Storage in the file group system
The paths are hard-wired and not configurable. It is the same file group that templates reach via the load option source: "system" (see $wsExternalData).
<subshopId>is the ID of the subshop, for exampledeutsch,english,francais. Each subshop has its own folder and reads exclusively its own page directory.- The name of the directory file is configurable via
cmsTemplates.mappingFile(defaultindex-mapping.json). The folderjson/is not. - The folder structure below
json/<subshopId>/is arbitrary. The Strapi structure is common, for examplecollections/contentpage/jyllb6ubw0dj62vndr0lh7z1.json.
The file name has no meaning. It has no influence on the URL of the page. That is defined exclusively in the field
url in the page directory or in meta.url of the document.Which URL belongs to which file
The page directory answers this question:
On each run of the SEO URL generator, the URLs of all matching entries are re-registered, and all already registered CMS URLs that are no longer in the directory are removed. As a result, a page that has been deleted or set to
stage:draft disappears by itself the next time the SEO URLs are generated.
Notes on the URL
The value fromurl is taken over as the final path. The shop merely adds a slash in front and, if necessary, appends the trailing slash. This has several consequences:
- No leading slash. The shop adds it itself. A value like
"/AGB"leads to a double separator (//AGB) and thus to an unreachable page. - The trailing slash is added automatically according to the shop configuration (
urls.urls.alwaysEndWithSlash). - No character set check and no normalization. Uppercase letters are explicitly common (
AGB,Zahlungsarten). - The shop’s URL processing does not apply here. Of the settings under urls.urls, only
activeandalwaysEndWithSlash(plussuffixSeparatorin the event of a collision) affect CMS URLs.lowercase,wordSeparator, and the charactermappingsfor umlauts are not applied – unlike for category and product URLs. So even withlowercase: true,AGBbecomes the path/AGB. - The URL is compared exactly when called, that is, including upper and lower case.
/agbdoes not find a page registered asAGB. - Special characters and spaces must already be encoded. The value is treated as an already encoded path and is decoded. It is cleaner to avoid them in Strapi.
- URLs already set manually in the Admin Interface win. If a manually set URL exists for a page, the value from the page directory is silently ignored, without a log message. A changed
urlthen has no effect. - In the event of a path collision, the shop appends
suffixSeparatorplus a number instead of aborting the registration. The page is then reachable under an unexpected URL, and there is no log message about it. Older paths of the same page are redirected to the current path via 301.
AGB should not be altered by automatic lowercasing.
The page document
Every document has the same outer structure, the so-called “envelope”:contentType, meta, and fields. It is the same envelope as in the schema format of the sync middleware, which is described in detail under Migration of the Strapi data structure (version 5).
The principle here is: the envelope is fixed, the content is free.
The shop only guarantees the evaluation of the SEO block. What
fields looks like is determined solely by the modeling of the content types in Strapi. How it is displayed is determined solely by the template.
The SEO block in meta
The shop evaluates these fields:
All other
meta fields (id, documentId, locale, createdAt, updatedAt) are Strapi administrative data. They are not evaluated but are available to the template.
meta.hreflang is part of the envelope and is available in the template, but it is not automatically included in the shop’s hreflang details. $wsViews.current.getHreflangAutomatic() returns nothing for CMS pages. If you want to output alternate languages, you have to render them yourself in the template, see Template theme.
Draft and publication
There are two switches that are independent of each other:stagein the page directory decides whether the URL is created at all.liveor empty → the URL is registered. Anything else → no entry, the page is not addressable.meta.publishedAtin the document decides whether the page is delivered.
Drafts can therefore be previewed in the shop by enabling test mode, just like other preview content. See Enabling and disabling shop test modes.
Configuration
The configuration nodecmsTemplates is located in the content area:
The node is a singleton and can be overridden per subshop. All details under content.cmsTemplates.
If a CMS page does not appear
The messages of the SEO URL generator and of the page call can be found in the LogManager via these codes:
Media library
Strapi has an integrated media library that enables central management of media such as images, PDFs, and other files. All uploaded images and files are stored in the media library and can be managed from there. This includes deleting, replacing, or reusing media in different parts of the Strapi project.Uploading media
Media can either be uploaded directly to the media library or added during content maintenance. When media is needed while editing content, the media library can be used. Here you have the option to select already uploaded files or to add new files.Automatic image conversion
Strapi has a built-in converter that automatically compresses uploaded images to improve loading times and optimize storage requirements. In addition, the WEBSALE image converter is used, which converts images into the SourceFormat and the WebP format. These formats offer improved compression rates and are optimized for web use.Template integration
The template manager defines within the template which image is used in which format. New images and media elements added to the media library must therefore be placed and configured in the template according to the template manager’s specifications. More information for template managers is available here.Extending Strapi for subshops
Create a new language
- Settings → Internationalization
- “Add new language”
- Select language.
- Do not change the display name.
- Note / copy the locale ID. For example, “French (fr)” - fr would be the locale ID here.
- Save.
Assign a language to a subshop
- Content Manager → Configuration
- Choose ”+ Add entry” or edit an existing one.
- Under “WEBSALE Subshop ID”, a comma-separated list of subshop IDs can now be entered.
- Under “Strapi locale ID”, the “locale ID” copied in the previous step must be inserted.
- Save afterwards.
The WEBSALE Strapi connector now automatically considers the new language.
Content maintained in the Content Manager for this language is placed on the shop server in the directories for subshops. Each value (comma-separated) represents a subshop folder.
Content maintained in the Content Manager for this language is placed on the shop server in the directories for subshops. Each value (comma-separated) represents a subshop folder.
