Questions tagged [static-content]

Denotes questions related to Static Content in Magento2.

Filter by
Sorted by
Tagged with
32
votes
15answers
118k 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 ...
22
votes
6answers
22k 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 ...
31
votes
7answers
37k views

magento2: 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 ...
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:...
18
votes
13answers
30k 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. ...
3
votes
5answers
4k 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 ...
1
vote
1answer
640 views

Show terms and conditions on static page

Is there a way to show the terms and conditions on a page via .phtml? I have made a page via a module and now want to show the terms and conditions on that page.
1
vote
1answer
529 views

CSS not load Magento 2

I installed a module, and then I uninstalled it. Since then I do not have CSS. I did not find the frontend nor the CSS but after running this: php bin/magento setup:static-content:deploy php bin/...
0
votes
1answer
1k 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 ...
9
votes
1answer
3k 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 ...
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 ...
2
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 ...
1
vote
0answers
685 views

Magento 2 - Custom admin theme not working in production mode

I create a custom admin theme to override few admin template files. In developer mode theme work perfect, but when I turn on production mode and make: bin/magento setup: static-content: deploy then: ...
0
votes
2answers
2k views

Error in Magento 2 when trying to deploy

I have this error: Fatal error: Class 'Locale' not found in vendor/magento/framework/Locale/Bundle/DataBundle.php on line 64 in Magento 2 when I try do use this command to clear the cached ...
6
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 ...
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
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. ...
2
votes
3answers
749 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
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 not loading so, I remove pub/static content then, regenerate the static content, after that I checked css url path http://...
1
vote
1answer
347 views

automatic generation of dir/files under pub/static not working

automatic generation of dir/files under pub/static not working. When i google about this find that i have to delete that file in which i did change and then run below given command. php bin/magento ...
1
vote
3answers
2k views

Static content deploy - Compilation from source

Doing a setup:static-content:deploy never finishes deploying files on a custom theme. Instead gives Compilation from source: frontend/Vendor/theme/en_US/css/email-fonts.less and then stops compiling. ...
1
vote
3answers
10k views

Magento2: Wrong path of static contents

I know so many others have asked the same question but still no reliable ans is available. Suddenly my site is hitting the wrong path of static content (CSS/JS/IMAGES) because of this my site is not ...
0
votes
1answer
286 views

Unable to import custom less file in custom theme's modules in Magento2

I have created a custom theme in Magento 2 and I want to add _customvariables.less and _custommixins.less in all other less files. I have added these files in the following location. magento2/app/...