Closed mikemix closed 6 years ago
This is how: Sylius\Bundle\ThemeBundle\Asset\Package\PathPackage
works. If requested asset is not an absolute URL, it merges the path with the theme context if one is set:
if ($this->isAbsoluteUrl($path)) {
return $path;
}
$theme = $this->themeContext->getTheme();
if (null !== $theme) {
$path = $this->pathResolver->resolve($path, $theme);
}
My bad :D :dagger:
Anyway, thanks for the information. There were many people in the community that had problems with theming in this plugin. CC @patrick477.
Well the sylius:theme:assets:install
command has to be called. I have now duplicated assets which doesn't make any sense but fkit ;)
We will mention it in the README. Thanks!
When I enter any form within this bundle (either block form or page form) bundle tries to load its JS resources using invalid URL:
1. Page at: http://localhost:8080/app_dev.php/admin/pages/new
Requested resources (with 404 error): http://localhost:8080/bundles/_themes/[theme_name]/default/bitbagsyliuscmsplugin/js/bitbag-page-slug.js http://localhost:8080/bundles/_themes/[theme_name]/default/bitbagsyliuscmsplugin/js/bitbag-page-slug.js
2. Page at: http://localhost:8080/app_dev.php/admin/blocks/new/image
Requested resources (with 404 error): http://localhost:8080/bundles/_themes/[theme_name]/default/bitbagsyliuscmsplugin/js/bitbag-block-image-preview.js http://localhost:8080/bundles/_themes/[theme_name]/default/bitbagsyliuscmsplugin/js/bitbag-block-image-preview.js
Yep, both are requested twice lol. The base path for the resources should be:
/bundles
. This is my directory structure:I'm using: