-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Can't seem to create a theme #494
Comments
@fronbow what if you enter your path for both |
I have a custom theme open right now - here's how the file structure looks in mine: And in /*
|--------------------------------------------------------------------------
| Theme (User Interface)
|--------------------------------------------------------------------------
*/
// Change the view namespace in order to load a different theme than the one Backpack provides.
// You can create child themes yourself, by creating a view folder anywhere in your resources/views
// and choosing that view_namespace instead of the default one. Backpack will load a file from there
// if it exists, otherwise it will load it from the fallback namespace.
'view_namespace' => 'theme-bootstrap.',
'view_namespace_fallback' => 'backpack.theme-coreuiv4::', Maybe it helps 🤷♂️ |
Cheers @tabacitu I'll explore these tomorrow when I get back to my desk and let you know how I get on |
I get a 500 error
even though I have a |
I've done it like this and everything shows, but backpack isn't reading the templates in my theme directory, it's just defaulting to the fallback theme's files. So instead of reading my This is turning out to be a very interesting problem!!! |
Hey @fronbow This may be interesting yes. Let's see if we can catch up. I've just tested exactly what you said in two scenarios: So I created the The dashboard will overwrite the default dashboard of backpack, and I added a route Is it possible that you have your configs cached or something similar ? Cheers |
Hey @fronbow |
Hi @pxpm, I just cleared the config:cache and it's still not showing my dashboard, and thanks @karandatwani92 it wasn't updated when I started this, it just referred to the github comment. I'll go test the updated docs kindly posted by @karandatwani92, hopefully my mileage will be better!! Cheers All :) |
Nope, my mileage is still the same. I've duplicated the folder layout under views, cleared all known caches!, and I even changed the view_namespace_fallback to the same as view_namespace (which still results in the 500 error). The only way I seem to be able to alter the theme view is if I edit the files under I'm now wondering if there's something I'm missing or if I need to fire-up a blank backpack install and test the theme stuff there before adding in all my CRUD files |
I've just replicated this and got the 500 error again:
I keep clearing everything that can be cleared!!!
|
I think I get your error now. Can you show me what you added in I guess you added: I tried to raise the same error (giving it a view that doesn't exist) and I noticed that my error didn't contain the Cheers |
You're right, I did add the full filename. I've just changed it to
page. I'm still confused as to how you and @tabacitu can get your own themes working yet mine fail. My dev machine is linux, so I'm trying to see how windows behaves (though that has its' own set of problems!!) Cheers |
I don't think this is related to windows/linux. We are just serving simple blade files, it's core Laravel functionality. We just check in some more places when you use What do you have inside your Cheers |
This is the entirety of my
I (@pxpm ) edited this comment to remove all other routes. They are not relevant to this issue. |
Hi @pxpm , Cheers for all your help :) |
No problem @fronbow, anytime. Glad you made it work! If you enjoy your creation and want to share your theme with others consider releasing it as a package 🙏 Cheers |
Bug report
What I did
Trying to create a theme so I can override some colour choices of tabler (not found an easy way to do this yet!)
I've gone through the updated docs in (#417) and can't get my theme to be picked up by backpack.
In ui.php I commented out the view_namespace_fallback variable so that I could check if my files were being read and I get a 500 error.
The view: [backpack.ui::blank] was not found in any of the following view paths: [my-theme-folder.::blank ], [ backpack.theme-coreuiv2::blank ], [ backpack.ui::blank]- Called in: /storage/framework/views/9bd51d16f96d06902e0c9283968e1990.php on line: 21
even though I have a blank.blade.php file in the root of the theme folder.
My theme lives in
resources -> views -> my-theme-folder
.If I reinstate the view_namespace_fallback variable then the error goes away but I'm left with no customisations, just the fallback theme.
What I've already tried to fix it
Going through the docs on the github issue, moving the theme folder to various different positions in the resources path
Is it a bug in the latest version of Backpack?
Yes, as far as I can tell
Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:PHP VERSION:
PHP 8.1.12-1ubuntu4.2 (cli) (built: Jun 28 2023 13:56:12) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.12, Copyright (c) Zend Technologies
with Zend OPcache v8.1.12-1ubuntu4.2, Copyright (c), by Zend Technologies
with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethans
LARAVEL VERSION:
10.17.1.0
BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.1.1
backpack/crud: 6.1.3
backpack/generators: v4.0.2
backpack/logmanager: v5.0.0
backpack/permissionmanager: 7.0.0
backpack/pro: 2.0.10
backpack/theme-coreuiv4: 1.0.5
backpack/theme-tabler: 1.0.6
Cheers for any help/clarification if this isn't a bug!
The text was updated successfully, but these errors were encountered: