1. Go to this page and download the library: Download snowsoft/oapage-designer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use App\Http\Controllers\PageDesignerController;
Route::get('/page/{id}', [PageDesignerController::class, 'index'])->name('page-designer');
$form->pagedesigner('data', __('pageDesign'));
// set snap
$form->pagedesigner('data', __('pageDesign'))->snap(30);
use OpenAdmin\Admin\PageDesigner\Traits\PageDesignItem;
class PageDesignerQuoteController extends AdminController
{
use PageDesignItem;
public function __construct()
{
$this->initPageDesignItem();
}
public static function pageDesign()
{
return [
'parent_field'=> 'page_id',
'type' => 'quote',
'title' => 'quote',
'icon' => 'icon-quote-right',
'model' => "\App\Models\PageDesignerQuote",
];
}
// this part renders the content part of the item
// the rendering on the frond-end is seperate, but offcourse you can let them share styles
public static function pageDesignScripts()
{
return <<<'JS'
// use the type as writen above + 'SetContent'
window.quoteSetContent = function(data,current_content){
current_content.innerHTML = '<h2>Quote: '+data.quote+'</h2>';
};
JS;
}
...