Display Pages
This guide explains how to display pages created with the Livewire Page Builder.
Basic Implementation
To display a page, you need to:
- Create a Livewire component
- Add the renderer component to your view
- Pass the page content to the renderer
Create a Livewire Component
<?php
namespace App\Livewire;
use App\Models\Page;
use Livewire\Component;
class DisplayPage extends Component
{
public Page $page;
public function mount(Page $page)
{
$this->page = $page;
}
public function render()
{
return view('livewire.display-page')->layout(config('livewire-page-builder.render_layout'));
}
}
Add the Renderer to Your View
<div>
<livewire:lpb.renderer :content="$page->content" />
</div>