Search by

sisl-source / magento2-simpledata

SISL-source

The SimpleData module simplifies calling Magento data structures.

Package info

github.com/SISL-source/magento2-simpledata

Type:magento2-module

pkg:composer/sisl-source/magento2-simpledata

Fund package maintenance!

markshust

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-09-15 12:52 UTC

This package is auto-updated.

Last update: 2026-09-18 17:25:25 UTC


README

A developer helper for programmatically managing CMS content in Magento 2. Instead of wiring up repositories, interfaces and factories by hand, you call a single method:

$this->block->save([
    'identifier' => 'footer-links',
    'title'      => 'Footer Links',
    'content'    => '<p>…</p>',
    'is_active'  => 1,
    'stores'     => [0],
]);

save() is idempotent (upsert by identifier + store_id): if the block/page exists it is updated, otherwise it is created. There is also delete($identifier, $storeId). On top of that, an abstract base SimpleDataPatch (implements DataPatchInterface) that you extend to seed CMS content from a data patch without the boilerplate.

This is a maintained fork of the abandoned markshust/magento2-module-simpledata (Mark Shust, 94★, last commit 2023). The original declares very loose php: >=7.1 / magento/framework: >=101; the fork pins the dependencies and is verified on Magento 2.4.9 / PHP 8.4 (di:compile + a create/read/delete test of a CMS block against a live database).

Compatibility

  • Magento 2.4.4 – 2.4.9 (Open Source / Adobe Commerce)
  • PHP 8.1 – 8.4

Installation

composer require sisl-source/magento2-simpledata
bin/magento module:enable MarkShust_SimpleData
bin/magento setup:upgrade
bin/magento setup:di:compile   # production mode

Example: a data patch seeding a CMS block

use MarkShust\SimpleData\Setup\Patch\SimpleDataPatch;

class CreateFooterBlock extends SimpleDataPatch
{
    public function apply(): self
    {
        $this->block->save([
            'identifier' => 'sisl-footer',
            'title'      => 'SISL Footer',
            'content'    => '<p>© SISL</p>',
            'is_active'  => 1,
            'stores'     => [0],
        ]);
        return $this;
    }
}

API

  • MarkShust\SimpleData\Api\Cms\SimpleBlocksave(array $data), delete(string $identifier, int $storeId)
  • MarkShust\SimpleData\Api\Cms\SimplePage — same, for CMS pages
  • MarkShust\SimpleData\Setup\Patch\SimpleDataPatch — abstract data-patch base

License

MIT (same as upstream). Fork maintained by SISL.

Maintained by SISL

Maintained fork by SISLMagento 2 development and modules. More self-hosted plugins: SISL Marketplace.