Can't view preview in admin mode #6994
-
I have problem when trying to preview any page ONLY in admin mode. I got 404 Error message, like this"[Tue Feb 7 20:59:18 2023] ::1:53328 [404]: /admin/preview/assets/css/theme.min.css" localhost:8000 - retrieve good feedback from assets folder ( my assets folder is in public/ ) QUESTION 2:I also got template for sulu project, that template contains this -> in root folder of template i have package.json & gulpfile.js . I still didn't put them in sulu project, because i didn't know where i need to put them... Next , in addition to the packages listed above i have public folder which contains html files of template , folder assets which contain (css,fonts,img,js,vendor). Im confused because vendor folder in assets folder have node_modules , should i run npm there? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The So your CSS Sulu does not force you how to embed your CSS or JS. Symfony itself has webpack encore which you can use to build your css and embed it in your base template: https://docs.sulu.io/en/2.5/cookbook/webpack-encore.html But at the end you can do what you are most familiar with to embed css/js the way you like most and build the assets with the tool you are most familiar with. Also checkout the Symfony assets component: https://symfony.com/doc/current/components/asset.html / https://symfonycasts.com/screencast/symfony/assets. An example Sulu page with CSS build can also found here the Sulu Demo: https://github.com/sulu/sulu-demo |
Beta Was this translation helpful? Give feedback.
The
/admin/preview/assets/css/theme.min.css
sounds like you accidently used arelative
path for your CSS instead of a absolute path. I think you should get a similar error when you are on a subpage like/some/subpage
.So your CSS
<link href="assets/css/theme.min.css" ...
should be changed to<link href="/assets/css/theme.min.css" ...
.Sulu does not force you how to embed your CSS or JS. Symfony itself has webpack encore which you can use to build your css and embed it in your base template: https://docs.sulu.io/en/2.5/cookbook/webpack-encore.html
But at the end you can do what you are most familiar with to embed css/js the way you like most and build the assets with the tool you are most …