Skip to content

Jade-GG/statamic

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rapidez Statamic

This package helps you integrate Statamic within your Rapidez project by adding some good starting points:

  • Products, categories and brands are integrated through Runway as read only resources so you can link them to the content
  • Products, categories and pages collections as starting point so you can extend this however you'd like
  • Route merging so Statamic routes work as fallback
  • Page builder fieldset with a product slider, content, image and form component
  • Responsive images with spatie/statamic-responsive-images
  • Breadcrumbs for pages
  • Globals available in all views

Requirements

You need to have statamic/cms installed in your Rapidez installation. Follow the installation guide.

Installation

composer require rapidez/statamic

Configuration

Have a look within the rapidez-statamic.php config file, if you need to change something you can publish it with:

php artisan vendor:publish --provider="Rapidez\Statamic\RapidezStatamicServiceProvider" --tag=config

Assets disk

Make sure there is an assets disk within config/filesystems.php

'disks' => [
    'assets' => [
        'driver' => 'local',
        'root' => public_path('assets'),
        'url' => '/assets',
        'visibility' => 'public',
    ],
],

Routing

As Rapidez uses route fallbacks to allow routes to be added with lower priority than Magento routes, this package is used to fix this, as statamic routes on itself will overwrite your Magento routes. Make sure default Statamic routing is disabled in config/statamic/routes.php. We'll register the Statamic routes from this packages after the Magento routes.

'enabled' => false,

Homepage

If you'd like to use the homepage from Statamic instead of the CMS page from Magento; just disable the homepage in Magento.

Publish Collections, Blueprints and Fieldsets

php artisan vendor:publish --provider="Rapidez\Statamic\RapidezStatamicServiceProvider" --tag=rapidez-statamic-content

And if you'd like to change the views:

php artisan vendor:publish --provider="Rapidez\Statamic\RapidezStatamicServiceProvider" --tag=views

Magento Store ID

It is important to add the Magento store ID in the attributes section within config/statamic/sites.php for every site

'sites' => [
    'default' => [
        'name' => config('app.name'),
        'locale' => 'nl_NL',
        'url' => '/',
        'attributes' => [
            'magento_store_id' => 1,
        ]
    ],
]

Showing content on categories and products

By default you'll get the configured content on categories and products available withint the $content variable. This can be enabled/disabled with the fetch configurations within the rapidez-statamic.php config file. If you want to display the configured content from the default page builder you can include this in your view:

@includeWhen(isset($content), 'rapidez-statamic::page_builder', ['content' => $content?->content])
  • Product: resources/views/vendor/rapidez/product/overview.blade.php
  • Category: resources/views/vendor/rapidez/category/overview.blade.php

Forms

When you create a form you could use rapidez-statamic::emails.form as HTML template which uses the Laravel mail template with all fields in a table, make sure you enable markdown!

License

GNU General Public License v3. Please see License File for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 71.6%
  • Blade 25.8%
  • Vue 1.9%
  • JavaScript 0.7%