Skip to main content

Display Pages

This guide explains how to display pages created with the Livewire Page Builder.

Basic Implementation

To display a page, you need to:

  1. Create a Livewire component
  2. Add the renderer component to your view
  3. 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>