Download the PHP package clevyr/nova-page-builder without Composer
On this page you can find all versions of the php package clevyr/nova-page-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download clevyr/nova-page-builder
More information about clevyr/nova-page-builder
Files in clevyr/nova-page-builder
Package nova-page-builder
Short Description A Clevyr built Nova Page Builder Resource
License MIT
Informations about the package nova-page-builder
Clevyr Nova Page Builder
How to Install
Install via Composer
Publish migrations, Default page config, PageBuilder Vue components, Nova resource and Model
Migrate the database
How to Create Navigation
- Create the "Header" navigation in the Nova admin.
- Add
import MainNav from '@/PageBuilder/partials/MainNav';
to the Vue component AppLayout.vue (resources/js/Layouts/AppLayout.vue
) - Then, add
MainNav
to thecomponents{}
object - Then, add the
<main-nav />
component to the template. This should be inserted next to the "Dashboard" link in the default Jetstream AppLayout component, you can customize and move this as needed.
What’s Included:
There will be 3 new sections in Nova now: Menus, File Manager and Pages.
Config Files
nova-page-builder.php
- This file lets you set what model
, resource
, views_path
and locales
is used for the
page
builder.
You can update these as necessary.
nova-menu.php
- This file configures the Menu Builder package. This is where you set the locales
available for
the Page Builder.
nova-tinymce.php
- This file is a custom config for the TinyMCE Rich-Text-Editor.
filemanager.php
- The config file from the Filemanager plugin.
Pages
Pages require templates. Templates have 2 dependencies, a config file with sections available in that template and a Vue file to render the template. The Page Config file and the Page Template parent directory need to be named the same, capitalization and all.
ex: {views_path}/pages/{LayoutName}.php
& resources/js/Pages/{LayoutName}/Index.vue
Page Config
The config is made up of Nova fields in an array syntax. This uses the Flexible Content package. You can read more docs here: https://github.com/whitecube/nova-flexible-content. To see an example, please refer to {views_path}/pages/Default.php
Page Vue Template
This package currently works off Inertia so you will create your page layouts in resources/js/Pages/{LayoutName}/Index.vue
. To see an example, please refer to resources/js/pages/Default/Index.vue
Default Page Template Components
Out of the box, this package includes the Hero, One Column Layout and Two Column Layout components. These are in the resources/js/PageBuilder
directory. You can modify these at any time.
Menu
Menu is coming from https://github.com/optimistdigital/nova-menu-builder. The page builder package publishes the config for the menu builder package. You can create custom menu item types and everything else from the docs.
Rendering the Menu
To render the menu in the Vue app, include the <main-nav>
component from the resources/js/PageBuilder/partials/MainNav.vue
file. This will render a menu with an <jet-nav-link>
for each link. This can also be customized.
File Manager
The File Manager is coming from https://github.com/clevyr/nova-filemanager.
Enabling GCS
You need the correct .env variables. DevOps can help with this.
To add Google Cloug Storage to the filesystem, add the following to the disks
array in filesystems.php
config file.
You can set the following .env
variables to target gcs
disk.
You will need to get the env variables and json key from DevOps.
Other packages included:
- Nova TinyMCE - https://github.com/emilianotisato/nova-tinymce
- Nova Sidebar Icons - https://github.com/anaseqal/nova-sidebar-icons
- Flexible Content - https://github.com/whitecube/nova-flexible-content
- Nova Tabs - https://github.com/eminiarts/nova-tabs
Locales and Translations
You can specify which locales are available in the nova-menu.php
file. The page builder config inherits from this
file.
Once you specify which locales are available, those options become available in the CMS for both Pages and Menu Items.
To switch locales, pass the locale key (ex: en
) as the 2nd route parameter to /locale/{locale}
. This route can be
found in the routes.php
file for this package.
Creating Page Layouts
Config File
To create new page layouts that will be available in the CMS, create a php file in {views_path}/pages/{LayoutName}.php
. You can view the Default.php
file to see how it works. The basics of it is an array of Nova fields that are named and will be available in the Vue file.
Vue File
This package is set up to use Inertia by default. To add an Inertia page, create a new Directory and Index.vue file in resources/js/Pages
. You can see the Default
Page as an example. The config file and Vue directory names need to be identical.
Accessing Content
Page data will be passed to the views automatically, thanks to Inertia. To get specific section data, we have a Vue mixin called SectionContent
that will return the content for a given section.
This will get the content for a section with the slug “intro” from the layout’s config file.
Meta Information
To inject the meta information into the layout view, add the <Head />
component to the <template>
of the AppLayout.vue
file.
Next, import and register the Vue component.
Tutorial to Create New Page Layout
We are going to create an “About” page that will just have a hero image and a wysiwyg section for an “introduction”.
Create the layout's config file
Create the file {views_path}/About.php
with the following content:
Create the Vue file
Create the file resources/js/Pages/About/Index.vue
with the following content:
Components in the above example
In the Vue file, we are importing multiple components.
<app-layout>
- Vue layout from Inertia<Head>
- This is component lets you pass meta information to the layout.<Hero>
- This is a shared partial from this package
Create Page Data
- In Nova, navigate to Pages and click “Create Page”
- Input a page title and select “About” from the template dropdown
- Select “Published”
- Click “Create Page”
- On the View screen, click the pencil to edit the page
- On the Edit page, click the “Content” tab
- On the “Content” tab, click the “Add Section” button
- Add the “Hero” section and input it’s content
- Add the “Introduction” section and input it’s content
- Click “Update Page”
You can now add the page to the Main Navigation via the Nova Menu Builder.
All versions of nova-page-builder with dependencies
whitecube/nova-flexible-content Version ^1.0
clevyr/nova-filemanager Version ^4.0
eminiarts/nova-tabs Version ^2.0
outl1ne/nova-menu-builder Version ^7.0
emilianotisato/nova-tinymce Version ^2.0