open-admin
open-admin copied to clipboard
Getting 2 Sidebars or double templates when clicking links created with Menu admin
Describe the bug
I created a new menu item via the Menu admin, whenever I click the new menu item, I get the correct page but it is wrapped in the template twice. So I am seeing 2 Sidebars and 2 Headers (See attached photo)
I am using the Grid/List view.
I tried just returning the grid() method with no luck, and now I return the index() method with $this->grid() in the body property.
Index Method
public function index(Content $content)
{
return Admin::content(function (Content $content) {
$content
->title('New Page')
->description('List of Items')
->breadcrumb(
['text' => 'Dashboard', 'url' => '/admin'],
['text' => 'New Page']
)
->body($this->grid());
});
}
Grid Method:
protected function grid()
{
$grid = new Grid(new Pages());
$grid->column('page_id', 'ID')->sortable();
$grid->column('page_name', 'Page')->sortable();
$grid->column('created_at', 'Created At')->display(function ($createdDate) {
return date(DateFormat, strtotime($createdDate));
})->sortable();
$grid->column('updated_at', 'Updated At')->display(function ($createdDate) {
return date(DateFormat, strtotime($createdDate));
})->sortable();
$grid->filter(function ($filter) {
$filter->like('page_name', 'Page');
});
$grid->actions(function ($actions) {
$actions->disableView();
});
$grid->batchActions(function ($batch) {
$batch->disableDelete(); // Disable the batch delete button
});
return $grid;
}
Greetings, have you managed to fix this error? The same thing is happening to me. =( But when I refresh the page, the correct information is displayed.