PHPackages                             fond-of-spryker/contentful - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fond-of-spryker/contentful

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fond-of-spryker/contentful
==========================

A contentful connector for spryker.

5.1.0(3y ago)521.2k1[1 PRs](https://github.com/fond-of/spryker-contentful/pulls)3MITPHPPHP &gt;=7.4

Since Apr 23Pushed 8mo ago2 watchersCompare

[ Source](https://github.com/fond-of/spryker-contentful)[ Packagist](https://packagist.org/packages/fond-of-spryker/contentful)[ RSS](/packages/fond-of-spryker-contentful/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (33)Used By (3)

fond-of-spryker/contentful
==========================

[](#fond-of-sprykercontentful)

[![license](https://camo.githubusercontent.com/850eae1099d2b05f53383473d7cd51f9bc1ab09b7d0d9e5122f1dd930efdcc6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6173686170652f6170697374617475732e737667)](https://packagist.org/packages/fond-of-spryker/contentful)

A Spryker-Contentful connector. Import content from contentful to storage and updates it via cronjob.

Install
-------

[](#install)

```
composer require fond-of-spryker/contentful

```

### 1. Add twig service provider to YvesBootstrap.php in registerServiceProviders()

[](#1-add-twig-service-provider-to-yvesbootstrapphp-in-registerserviceproviders)

```
$this->application->register(new ContentfulTwigServiceProvider());

```

### 2. Add ContentfulRouter to YvesBootstrap.php in registerRouters()

[](#2-add-contentfulrouter-to-yvesbootstrapphp-in-registerrouters)

```
$this->application->addRouter((new ContentfulRouter())->setSsl(false));

```

### 3. Add console command to ConsoleDependencyProvider.php in getConsoleCommands()

[](#3-add-console-command-to-consoledependencyproviderphp-in-getconsolecommands)

```
new ContentfulConsole(),

```

### 4. Add configs to your shop config file or in config/Shared/config\_default.php

[](#4-add-configs-to-your-shop-config-file-or-in-configsharedconfig_defaultphp)

Example configuration

```
// API-Key
$config[\FondOfSpryker\Shared\Contentful\ContentfulConstants::CONTENTFUL_ACCESS_TOKEN] = 'fu';
// Space id
$config[\FondOfSpryker\Shared\Contentful\ContentfulConstants::CONTENTFUL_SPACE_ID] = 'bar';
// Space default locale
$config[\FondOfSpryker\Shared\Contentful\ContentfulConstants::CONTENTFUL_DEFAULT_LOCALE] = 'en';
// Optional: To deactivate an entry. If Field doesn't exists entry is always shown. Default is "isActive"
$config[\FondOfSpryker\Shared\Contentful\ContentfulConstants::CONTENTFUL_FIELD_NAME_ACTIVE] = 'isActive';
// Optional: If entry is a page, this is the field where the url is stored. Default is "identifier"
$config[\FondOfSpryker\Shared\Contentful\ContentfulConstants::CONTENTFUL_FIELD_NAME_IDENTIFIER] = 'identifier';
// Mapping of contentful locales to available shop locales
$config[\FondOfSpryker\Shared\Contentful\ContentfulConstants::CONTENTFUL_LOCALE_TO_STORE_LOCALE] = [
    'en' => 'en_US',
    'de' => 'de_DE'
];

```

### 5. Add cronjob in jobs.php

[](#5-add-cronjob-in-jobsphp)

Retrieve updated contentful entries every 5min.

```
$jobs[] = [
    'name' => 'contentful-updater',
    'command' => '$PHP_BIN vendor/bin/console contentful:import -vvv',
    'schedule' => '*/5 * * * *',
    'enable' => true,
    'run_on_non_production' => true,
    'stores' => $allStores,
];

```

### 6. Run

[](#6-run)

```
vendor/bin/console transfer:generate
vendor/bin/console contentful:import --all

```

Console commands
================

[](#console-commands)

Import last updated entries (last 5min)

```
vendor/bin/console contentful:import

```

Import all

```
vendor/bin/console contentful:import --all

```

Import entry by id

```
vendor/bin/console contentful:import [entryId]

```

Usage in twig templates
=======================

[](#usage-in-twig-templates)

Template path is Theme/default/contentful/\[contentType\].twig

```
 {{ contentfulEntry('contentfulEntryId') }}

```

Access contentful properties in twig templates like the following example:

```
 {{ entry.[fieldname].value }}

```

Markdown to html

```
 {{ entry.[markdownFieldName].value | Markdown }}

```

Image resize

```
{{ contentfulImage(entry.[assetFieldName].value, int width, int height) }}

```

Fields
======

[](#fields)

Text (Default)

```
{{ entry.[assetFieldName].type }} // 'Text'
{{ entry.[assetFieldName].value }} // Value

```

Boolean

```
{{ entry.[assetFieldName].type }} // 'Boolean'
{{ entry.[assetFieldName].value }} // Value

```

Asset

```
{{ entry.[assetFieldName].type }} // 'Asset'
{{ entry.[assetFieldName].value }} // Url of asset
{{ entry.[assetFieldName].title }}
{{ entry.[assetFieldName].description }}

```

Array

```
{{ entry.[assetFieldName].type }} // 'Array'
{{ entry.[assetFieldName].value }} // Array of fields

```

Reference

```
{{ entry.[assetFieldName].type }} // 'Reference'
{{ entry.[assetFieldName].value }} // ContentfulEntryId

```

Object (Json)

```
{{ entry.[assetFieldName].type }} // 'Object'
{{ entry.[assetFieldName].value }} // ContentfulEntryId

# Pages
- If the contentful entry has a "Indentifier" field (URL) it will be imported as page with the given route via IdentifierImporterPlugin.
- Add an additional ResourceCreator to add custom logic to a special contentful entry type.
- More documentation soon

```

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance42

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~56 days

Recently: every ~297 days

Total

31

Last Release

1240d ago

Major Versions

1.0.0-RC5 → 2.0.0-RC12018-07-06

2.2.2 → 3.0.02018-11-26

3.0.1 → 4.0.0-RC12019-02-20

4.7.1 → 5.0.02022-12-12

PHP version history (3 changes)1.0.0-RC1PHP &gt;=7.1

5.0.0PHP &gt;=7.3

5.1.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c8ae669ad5d4e25d1564b2ee381e86fb88b3d9f132040a1a6b642de43b7a417?d=identicon)[daniel-rose](/maintainers/daniel-rose)

![](https://www.gravatar.com/avatar/5766a5e1f2f31647ebd3e7ccfc434a968092eedbf3db8f6e999f3d8650d4521e?d=identicon)[Carpenter0100](/maintainers/Carpenter0100)

![](https://www.gravatar.com/avatar/2f5bd8b1a3358200680cbaf5d0dce827afb0569cc997877854354cc70bcf5a61?d=identicon)[julianzimmermann](/maintainers/julianzimmermann)

![](https://www.gravatar.com/avatar/c555494ccfc76f8679a78d4174f15a7d760471d36a999c5c6952e830d8b7a2c1?d=identicon)[gengjozsef](/maintainers/gengjozsef)

![](https://www.gravatar.com/avatar/e568ff715a8dc39b72d07873df23e2b14e0771a7f98ae50900dc4c057e2ed971?d=identicon)[DerCalli](/maintainers/DerCalli)

![](https://www.gravatar.com/avatar/f2b758f0afbac55036ef37f46e4d2e4369a0286c0f8085ca4950208654e556a4?d=identicon)[srccb](/maintainers/srccb)

---

Top Contributors

[![sourcecube](https://avatars.githubusercontent.com/u/3285018?v=4)](https://github.com/sourcecube "sourcecube (9 commits)")[![DerCalli](https://avatars.githubusercontent.com/u/35733274?v=4)](https://github.com/DerCalli "DerCalli (3 commits)")[![julianhyatt](https://avatars.githubusercontent.com/u/54834203?v=4)](https://github.com/julianhyatt "julianhyatt (3 commits)")[![SpiderDan98](https://avatars.githubusercontent.com/u/40319023?v=4)](https://github.com/SpiderDan98 "SpiderDan98 (3 commits)")[![daniel-rose](https://avatars.githubusercontent.com/u/489806?v=4)](https://github.com/daniel-rose "daniel-rose (1 commits)")[![tillhess](https://avatars.githubusercontent.com/u/442740?v=4)](https://github.com/tillhess "tillhess (1 commits)")

### Embed Badge

![Health badge](/badges/fond-of-spryker-contentful/health.svg)

```
[![Health](https://phpackages.com/badges/fond-of-spryker-contentful/health.svg)](https://phpackages.com/packages/fond-of-spryker-contentful)
```

###  Alternatives

[spryker/search

Search module

152.8M64](/packages/spryker-search)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
