styladev/spryker-plugin

There is no license information available for the latest version (1.0.1) of this package.

Styla Spryker Module

1.0.1 2019-06-18 14:47 UTC

This package is auto-updated.

Last update: 2024-03-29 03:32:56 UTC


README

This module provides integration with Styla content management system. It embeds Styla content on your Spryker (via JS), takes care of routing for it and server-side rendering of HTML tags.

This documentation page should provide you an overview of how Styla works in general.

Installation

The Styla spryker module can be added to your spryker shop via composer:

composer require styladev/spryker-plugin

Add the Styladev namespace to the spryker known namespaces within the configuration file:

$config[KernelConstants::CORE_NAMESPACES] = [
    'SprykerShop',
    'SprykerEco',
    'Spryker',
    'SprykerSdk',
    'Styladev'
];

Using GLUE API

Styla is using the glue api to allow the content creator to select products and for the visitor to allow the user to see more product details.

By default the glue api is not providing a product url which is necessary for the product integration. This plugin provides a transfer file to enable product urls in the glue api. To activate this please run the following command:

console transfer:generate

Now the glue api returns the necessary relative product url.

Configuration

Within the Spryker configuration for each locale the Styla client (you get it after signing contract) and additional the paths on which the styla integration should be displayed needs to be configured. The default configuration can be added to config_default.php and overridable with the more specific locale variants for example config_default_DE.php.

The configuration should look like this:

$config[StylaConstants::CLIENT] = 'spryker-test';
$config[StylaConstants::PATHS] = 'inspiration/.*';

The paths are always from the root path (e.g. after domain) and can contain a pipe separated list. Wildcards needs to be flagged with an additional /.*.

For example if you have these list of pages:

/inspiration/my-page1
/inspiration/my-page1
/my-world
/magazine
/magazine/category/summer
/magazine/my-summer-story

the path configuration should look like:

$config[StylaConstants::CLIENT] = 'spryker-test';
$config[StylaConstants::PATHS] = 'inspiration/.*|my-world|magazine.*';

In this case /inspiration and /magazine are wildcard urls and /my-world is a single page without a wildcard.

You can have Styla content on different path for each locale, for instance use /magazine for English and /magazin for German.

If you want to use your products in your Styla content, we will source it from your Spryker's Glue API. It needs to be configured on your end.