Onpage CMS Demo
ALPHA Things can and will break...
'providers' = [
...
marvinosswald\OnpageCMS\Providers\OnpageCMSServiceProvider::class
]
Right now you will need to setup a few things before you can start.
Please migrate the cms table.
The frontend overlay expects to send requests as PUT to api/cms
as of now this is hardcoded.
- PUT
api/cms
=>'\marvinosswald\OnpageCMS\Controllers\CMSController@updateBlock'
I don't publish a routing for it myself so you can setup authentication as you wish for example like this:
Route::put('api/cms',['middleware' => ['jwt.auth'], 'uses' => '\marvinosswald\OnpageCMS\Controllers\CMSController@updateBlock']);
The frontend overlay provides a login modal, therefor you need to provide a function which returns a token like {"token":"ABCYXZ"}
The Frontend expects to get a token with a POST
Request at /api/cms/login
you get the following fields as payload: email,password
You need to setup a loader script there is one included vendor/marvinosswald/OnpageCMS/resources/assets/js/opCMSLoader.js
you may just want copy the content into your app.js
or whatsoever because loader.uri
and loader.element
should be customized
- loader.element points to an id which acts as an activator for the overlay
- loader.uri must point to
opCMS.js
it gets copied to your public path something likepublic/opcms/js/opCMS.js
For instance you need to inject the cms directive into your view like:
@inject('cms', 'marvinosswald\OnpageCMS\Services\CMS')
Define cms blocks in your views. There are two types of block right now:
{!! $cms->text()->Title() !!}
Output:
<cms id="cms-en-#-Title"></cms>
Use the function call to set the name attribute like:
{!! $cms->meta()->description() !!}
Output:
<meta id="cms-en-#-meta-description" class="cms-meta" name="description" content="">
Generates a Title Tag like:
{!! $cms->meta()->title() !!}
Output:
<title id="cms-en-#-meta-title" class="cms-meta"></title>