Laravel-Backpack / CRUD

Build custom admin panels. Fast!
https://backpackforlaravel.com
MIT License
3.14k stars 892 forks source link

[Bug] Custom Theme default.blade.php Not Loading with Custom View Namespace #5697

Open azeddine-hf opened 1 day ago

azeddine-hf commented 1 day ago

this ui config : WhatsApp Image 2024-10-17 à 12 52 16_132273d3 this default blade path : WhatsApp Image 2024-10-17 à 12 55 25_dd8d8644 When accessing the admin panel, it should use my custom theme's default.blade.php as the main layout file. it take my sidebar and main_hearder but default no ?

pxpm commented 1 day ago

Hey @azeddine-hf thanks for the question, there is an issue in the docs.

Please create a file blank.blade.php at the root of your theme folder, similar to https://github.com/Laravel-Backpack/theme-coreuiv4/blob/main/resources/views/blank.blade.php

change the top line to import your default instead of top_left.

I will ask @jcastroa87 to submit a PR to docs to fix the issue 👍

Let me know if that works for you. Cheers

azeddine-hf commented 1 day ago

@pxpm it show me error 500

azeddine-hf commented 1 day ago

@pxpm sasasasasaas sazsasz

pxpm commented 1 day ago

Hey @azeddine-hf try clearing the caches with php artisan view:clear. Also make sure your .env file has APP_ENV=local and APP_DEBUG=true so you should get a nicer error message like:

The view: [backpack.ui::inc.main_header] was not found in any of the following view paths: [theme.inc.main_header ], [ backpack.theme-tabler::inc.main_header ], [ backpack.ui::inc.main_header]

So that you know what files are you missing.

I've just tested it out and it's working: image

Cheers

azeddine-hf commented 1 day ago

@pxpm thank you it works the error was in @include(backpack_view('inc.bottom')) not exist

azeddine-hf commented 23 hours ago

@pxpm where data didn't load after set my custom them and i set fallback_theme core_ui2

image

styles of datatable also not loaded ?? i'm i missed something !

pxpm commented 23 hours ago

Hey @azeddine-hf most likely your template is missing the @stacks and @yields where backpack pushes the scripts needed for stuff to work, datatables, fields etc.

Make sure your template include those 👍

azeddine-hf commented 22 hours ago

i have respected the docummentation instrection : `<!DOCTYPE html>

@include(backpack_view('inc.head'))
@include(backpack_view('inc.main_header'))
@include(backpack_view('inc.sidebar'))
@yield('before_breadcrumbs_widgets') @includeWhen(isset($breadcrumbs), backpack_view('inc.breadcrumbs')) @yield('after_breadcrumbs_widgets') @yield('header')
@yield('before_content_widgets') @yield('content') @yield('after_content_widgets')
@include(backpack_view('inc.bottom')) @include(backpack_view('inc.theme_scripts')) `
pxpm commented 22 hours ago

Like I told you, it's missing @stacks and @yields.

https://github.com/Laravel-Backpack/theme-coreuiv2/blob/11ec0cbaecefd3272601a7fb0d32457533a09ce6/resources/views/layouts/top_left.blade.php#L46

azeddine-hf commented 22 hours ago

@pxpm after i set this scripts it still refresh without loading the data : image

pxpm commented 22 hours ago

Check Browser developer tools for possible errors in console/network, I hope you know that just saying "this doesn't work" with an image does not help me much to help you.

Always try to provide any errors that are relevant for the reported bug. 👍