Questions tagged [static-content]
Denotes questions related to Static Content in Magento2.
145
questions
35
votes
16answers
130k views
Magento 2 CSS and JavaScript not loading from correct folder
I am hoping that someone on here can help. I am attempting to install and run Magento 2 on WAMP on a Windows 7 machine with little success.
After jumping through the many and various hoops to get ...
33
votes
7answers
41k views
Magento 2: How can I deploy my theme only
I was using this for deploy the content but it is taking too much time.
php bin/magento setup:static-content:deploy
then I figure out adding the language make fast but it still deploy all the ...
25
votes
6answers
26k views
Static Content is not loading after upgrade
After upgrade from the Magento 2.1.0 to the Magento 2.1.3 (using composer) static content is not loading anymore. In the browser console I can see that all files is unavailable (404):
I don't see ...
24
votes
4answers
4k views
Which compilation commands are needed in developer mode and when?
Can somebody give me instructions when to run which compilation commands in Magento 2 developer mode? I'm not sure if I understand it right yet.
In the devdocs, developer mode is described as follows:...
20
votes
7answers
17k views
Strange Error when running setup:upgrade after module installation
I have tried to install wyomind google shopping and have the following error when running bin/magento setup:upgrade.
[UnexpectedValueException]
Unable to retrieve deployment version of static files ...
19
votes
14answers
32k views
Missing write permissions in directory pub/static when run bin/magento setup:upgrade
The day before, I updated a new module and it was working normally. Now, when I run bin/magento setup:upgrade, I receive the below Exception. I tried setting permissions to 777 (or 770) for the pub ...
15
votes
2answers
3k views
Magento 2: Different static-content Files Per Locale?
In Magento 2, a static content URL looks like this
http://magento-2-with-keys.dev/static/adminhtml/Magento/science/en_US/Pulsestorm_FrontendTutorial1/hello.js
This includes a en_US locale portion. ...
11
votes
1answer
4k views
@media-common - Why do we need to use this?
In the Magento 2 lib documentation it contains the following:
@media-common: true|false - sets whether to output common styles. For common styles every time you want to add some styles you should use
...
10
votes
3answers
2k views
Use “ifconfig” to conditionally add CSS assets
Is there any way to use ifconfig in Magento 2 to conditionally add CSS assets, similar to Magento 1? Here's an example from Magento 1:
<action ifconfig="config_path/group/field" method="addItem"&...
8
votes
2answers
4k views
Get URL of the static content folder (for backend)
Inside a block class which is being used to render a button in the admin panel, how to get the URL of the static content folder? Specifically, URL of the folder with images?
For example, in ...
7
votes
2answers
10k views
Magento 2 - How to view static content deploy errors
When I run php bin/magento setup:static-content:deploy I have had some errors in my theme. I have got to the bottom of them but it was a pain, I had to manually go through all my LESS files to check ...
7
votes
2answers
3k views
How to get url for static image file in Magento2 javascript files?
Say you have a js file in your module: MyModule/view/frontend/web/js/. How would you reference the image found in MyModule/view/frontend/web/images/?
A solution would be this one, but looks wrong and ...
7
votes
1answer
2k views
Magento 2 setup:static-content:deploy symlinks
When removing all the pub/static files in Magento 2 and opening the homepage, the files are generated as symlinks. When using the command setup:static-content:deploy the files are copied, even after ...
7
votes
3answers
1k views
static-content deploy error
running static-content:deploy on multi store-view, fails with following error variable @media-common is undefined on theme where the language en_US
6
votes
2answers
1k views
Magento 2: Work Around for Loading Static Assets from Symlinks?
I just discovered that the official Magento 2.0 release (post public beta) doesn't support loading static assets from a symlinked folder. The root of the problem appears to be here
#File: vendor/...
6
votes
2answers
2k views
Magento 2: Nginx pub/static not autogenerating, only works with command line static-content:deploy
I have tried many of the solutions from: Local installation of Magento 2 doest not generate files in the pub/static folder and similar posts:
I am in developer mode (verified in command line, and I ...
6
votes
1answer
12k views
php bin/magento setup:static-content:deploy production site
Currently in Stores > All Stores I have one store view (Dutch).
When I do command php bin/magento setup:static-content:deploy it generates files for en_US. I know with the command php bin/magento ...
5
votes
5answers
11k views
There are no commands defined in the “setup:static-content” namespace
There are no commands defined in the "setup:static-content" namespace.
Did you mean one of these?
setup
setup:config
setup:cron
setup:db-data
setup:db-schema
setup:db
setup:di
setup:...
5
votes
0answers
1k views
Magento 2 - Unable to resolve the source file for image
I have created an image and have uploaded this to my theme/web/images folder. I have then ran the following:
php bin/magento setup:static-content:deploy
However I cannot get the image to show on ...
4
votes
2answers
4k views
Magento 2: Static files are present but shows 404
I installed Magento 2 in my local environment and executed each command:
php bin/magento cache:clean
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento ...
4
votes
6answers
5k views
Magento 2 How to make magento not to cache static content of Checkout module?
I'm modifying the checkout process, every time I edit a html file or a javascript file, I must use the command magento setup:static-content:deploy because the html or javascript is cached by magento. ...
4
votes
3answers
3k views
After changing default theme to custom theme contents and blocks missing
While developing custom theme when initialized my new theme from content -> theme -> selected my own theme after that my site content are missing.
But when i select some dropdown menu i can able to ...
4
votes
2answers
2k views
Knockout HTML template being cached
Does anyone know how to stop Knockout HTML templates from being cached (for dev purposes)? I don't have this issue with any other files (CSS, PHTML, XML, JS), it only happens with HTML templates.
As ...
4
votes
4answers
281 views
Css not working after Magento 2 installation on AWS
I've installed Magento 2 on AWS, however, the admin page is appearing like this:
What should I do?
Thanks!
3
votes
3answers
6k views
Custom theme - styles-m.css failed to open stream: No such file or directory
When setting up a new custom theme that has Magento/blank as a parent, we were able to deploy static assets locally but deploying to our staging site failed with an error.
[Magento\Framework\...
3
votes
5answers
5k views
Magento2 does not showing images/css/js
I have installed Magento 2 but for some reason all the css/js/images are not loaded.
Below are the steps I follow to install Magento 2
Create a sub-domain on cpanel
Downloaded Magento and uploaded ...
3
votes
9answers
5k views
Magento 2.1.3 static content issue
I have installed Magento 2.1.3 , After that I reload the page, css and js are not loading so, I remove the pub/static content. Then regenerate the static content, after that I checked css url path ...
3
votes
2answers
11k views
Fatal error: Class 'Locale' not found magento 2.0.2 [closed]
when I run this command
static-content:deploy
then I got the below error
"PHP Fatal error: Class 'Locale' not found in /opt/lampp/htdocs/magento/magento2_1/vendor/magento/framework/Locale/...
3
votes
2answers
3k views
how to speed up static content deploy for development
Especially after changing .html knockout js template files I have to always deploy static content with bin/magento setup:static-content:deploy <languages>.
This makes development very slow.
I ...
3
votes
2answers
342 views
Magento 2: What's the `Magento` in a Static Asset URL?
In Magento 2, a static asset URL from a module looks like this
http://example.magento.com/static/frontend/Magento/blank/en_US/Pulsestorm_FrontendTutorial1/hello.js
What's the Magento for between the ...
3
votes
2answers
3k views
Error while sending QUERY packet on static-content:deploy
I get the following error when I use static-content:deploy -vvv.
How can I remedy this?
If it is an issue with SQL max_allowed_packet, I am on a shared server so cannot change this myself, but may be ...
3
votes
2answers
911 views
Magento 2 : Custom Layout for Static Page Empty Into Frontend
I've create a custom layout for static page into Magento 2.
app/design/frontend/VENDOR/THEME/Magento_Cms/layouts.xml
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
3
votes
1answer
4k views
Magento Developer mode not working - still trying to load pub/static
Enabling developer mode in magento is giving some errors for me, it is still trying to load all my static content. Ive disabled the "sign static content" option.
Also, when I put my Magento ...
3
votes
1answer
364 views
Magento 2 - CMS Content Won't Save
I'm having a crazy issue where I'm trying to copy over CMS content and it seems that when there are certain words, the content does not save. It just refreshes the admin page and brings me back to ...
3
votes
2answers
1k views
Magento 2: Is deploying static content necessary in developer mode? [duplicate]
Some threads say compilation is not necessary in developer mode, what about static-content:deploy? When I working on magento 2 modules, I often have problems getting my changes updated in the front ...
3
votes
0answers
508 views
magento 2 custom email template image/logo not displayed
I am custom template for Magento 2
Created two new email template in admin backend
order confirmation email template
Shipment notification email template
Both are sharing same header and footer ...
2
votes
2answers
2k views
Magento2 developer mode doesnt generate static files on demand
I am running Magento 2 locally in developer mode
After installing i would not expect to have to run php bin/magento setup:static-content:deploy if in developer mode.
However, the only directory ...
2
votes
2answers
162 views
static content deploy issues
I'm having major issues with the static content deploy command because it doesn't give any errors but it isn't fixing my issue. Here is what my website looks like currently:
Here are the results of ...
2
votes
1answer
2k views
No progression after static-content:deploy en_GB
Running bin/magento setup:static-content:deploy en_GB and bin/magento setup:static-content:deploy however in both cases it randomly stops and doesn't carry on any further, I'm unable to use ctrl C in ...
2
votes
2answers
144 views
How to edit file in app/design/frontend without having to redeploy static content in Magento2?
Using Magento2, version 2.19
We are editing below file:
app/design/frontend/xx/xxxxx/Magento_Newsletter/templates/subscribe_popup.phtml
How can I show the changes to this file in the frontend of ...
2
votes
1answer
1k views
Unable to find styles-l.css original path in custom theme
I want to add/modify some styles to styles-l.css, but i am unabl to identify the original path location, as i mentioned the below static content file path.
pub/static/frontend/Smartwave/porto/en_US/...
2
votes
2answers
52 views
Overriding Magento 2 static adminhtml backend isn't working
I've got file :
"vendor/magento/module-ui/view/base/web/templates/grid/listing.html"
after deploy this file create:
"pub/static/adminhtml/Magento/backend/en_US/Magento_Ui/templates/grid/listing....
2
votes
3answers
973 views
Magento CSS Not Loading Error
I have tried every suggestion that is out there but im still getting this error
In my config data they are figured as:
i have tried the solutions none of them are working im still getting the same ...
2
votes
1answer
533 views
static-content:deploy not working
I'm overriding a core JS file in my module. When I run
php bin/magento static-content:deploy
and refresh the page the JavaScript does not seem to change.
I started tracking the issue. I found ...
2
votes
1answer
2k views
Magento 2.2 Build system
I trying to setup build system for setup:di:compile and setup:static-content:deploy based on official devdocs.
Build system
The build system compiles code and generates static view files for
...
2
votes
1answer
369 views
Magento 2: Change only one static file
Sometimes I only need to change one static file, is it possible to do that?
Example I have changes to: /static/versionxxxxxxxx/frontend/Superlove/custom/da_DK/Magento_PageCache/js/page-cache.js
Can ...
2
votes
1answer
599 views
Change background color Magento 2 header panel and compile less on Staging server
In /app/design/frontend/MyThemeName/my-theme/web/css/source/_theme.less I added @header-panel__background-color: @color-green-green1;
To change the background color of the header panel (I have a ...
2
votes
1answer
1k views
Magento2 not auto generate static files
i've some issues with auto generating static files in pub/static folder
after use magento setup:static-content:deploy if i delete some static file generated by deploy like css and i point to the url ...
2
votes
1answer
31 views
How to use Magento 2.3 and Cloudfare CDN?
I'm currently trying out the Cloudflare CDN (free plan), but I didn't notice much in website performance. My server was having "server load" problems and it did stop, but It seems the website's ...
2
votes
2answers
22 views
Page Styling (css) does not appear in the new Theme implementation (descendant of Luma Theme)
I just created empty theme which is descendant of Luma theme. but unfortunately the styling is not appear:
theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...