Creating Editable System Page

To make your system page editable, you need to do the following:

  1. Migration
  2. Creating route for WYSIWYG editview
  3. Push wysiwyg-section blade stack

Migration

You need to seed your app’s editable system page to core_system_page database table.

CoreSystemPage::updateOrCreate(
        [
            'page_name' => 'master-page-name',
        ],[
            'header_id' => 2, // Id core_header ,2 = non header.
            'sidebar_id' => 0, // Id core_sidebar , 0 = use sidebar with parent page.
            'footer_id' => 0, // Id core_footer , 0 = use footer with parent page.
            'content_view' => SystemPageLib::defMasterSystemContentView(),
            'content_edit' => SystemPageLib::defMasterSystemContentEdit(),
            'embed_meta' => '',
            'embed_js' => '',
            'embed_css' => '',
            'is_published' => 0, // 0 = Show in your site , 1 = Your site doesn't show.
            'user_id' => 1,
            'visibility_id' => 1, // Id core_visibility
            'page_name' => 'master-page-name',
            'role_id' => 1,
            'app_id' => 1,  // Id core_apps
            'published_at' => date('Y-m-d H:i:s'),
        ]
);

{info} If your master-page-name id = 12 in core_system_page table.

CoreSlug::updateOrCreate(
    [
            'slug_name' => 'master-page-name'
    ],[
            'slugble_id' => 12, // Id core_system_page
            'slugble_type' => config('core.model.system'),
            'slug_prefix' => 'rvsitebuilder/core', // Your vendor-name/project-name
            'slug_name' => 'master-page-name',
    ]
);
CoreSeo::updateOrCreate(
        [
            'meta_title_auto' => 'core-app-master'
        ],[
            'seoble_id' => 12, // Id core_system_page
            'seoble_type' => config('core.model.system'),
            'meta_title_auto' => 'core-app-master',
            'focus_keywords_auto' => 'This is description app-master in RVsitebuilder CMS',
            'meta_des_auto' => 'This is description app-master in RVsitebuilder CMS',
            'use_type' => 1,
        ]
);
CoreFacebook::updateOrCreate(
        [
            'fb_title_auto' => 'core-app-master'
        ],[
            'fbble_id' => 12, // Id core_system_page
            'fbble_type' => config('core.model.system'),
            'fb_title_auto' => 'core-app-master ',
            'fb_des_auto' => 'This is description app-master in RVsitebuilder CMS',
            'fb_type' => 'website',
            'featured_image' => config('rvsitebuildercms.cdn').'/templates/rvs_library/imageslibrary_v6/mrv_300x360/    otherimage/L/solidstockart-stock-photo-an-image-of-a-nice-autumn-la-568050.jpg',
            'fb_site_name' => 'Rvglobal soft',
            'use_type' => 1,
        ]
);
CoreTwitter::updateOrCreate([
            'twit_title_auto' => 'core-app-master'
        ],[
            'twitble_id' => 12, // Id core_system_page
            'twitble_type' => config('core.model.system'),
            'twit_title_auto' => 'core-app-master',
            'twit_des_auto' => 'This is description app-master in RVsitebuilder CMS',
            'twit_site' => 'website',
            'twit_creator' => 'Rvglobal soft',
            'featured_image' => config('rvsitebuildercms.cdn').'/templates/rvs_library/imageslibrary_v6/mrv_300x360/otherimage/L/solidstockart-stock-photo-an-image-of-a-nice-autumn-la-568050.jpg',
            'use_type' => 1,
        ]
);

Master System Page

You can define which system page ID is your master system page.

CoreApps::where('app_name', '=', 'rvsitebuilder/core') // vendor-name/project-name
        ->update(['master_systempage_id' => 12 ]); // Id core_system_page

System page blade file

wysiwyg-section blade stack

Add the following code at the bottom of your editable system page's blade file.

@push('wysiwyg-section')
    @if($editmode)
        @include('wysiwyg::user.layouts.section')
    @endif
@endpush

wysiwyg-section Blade Stack

Only editable system page is required. If your user page is not visually editable on admin WYSIWYG, you don't need it.

Control layout editor tools

You can control layout editor tools in section and block with a

...
element.you need to do the following:

Delete you can add class donotdelete for hide Delete Button in section and block.

Duplicate you can add class mgwidget for hide Duplicate Button in section and block.

Creating route for editview

editmode