Questions tagged [static-content]

Denotes questions related to Static Content in Magento2.

Filter by
Sorted by
Tagged with
1
vote
2answers
485 views

setup:static-content:deploy needs to run very frequently [closed]

Why does my css keep breaking and none of the clicks works in Magento2 frequently, even without any changes done in any of xml files. Everytime I need to run php bin/magento setup:static-content:...
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 ...
2
votes
1answer
136 views

How do I view/fix errors on static-content:deploy?

I am installing a theme and when I run bin/magento setup:static-content:deploy I get an error on some of the themes eg: === adminhtml -> Magento/backend -> en_US === ... Successful: 1997 files; ...
3
votes
1answer
265 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 ...
1
vote
1answer
210 views

Home page not showing the main content area: Magento

I am using Athlete Theme on my website: Site was working fine but today when i have checked it is missing the main page content and footer section. When I directly put all my contents to 1column....
1
vote
0answers
257 views

A faster route to deploying static content in Magento 2? Dev to Live etc?

Massive bounty on this guys. Wanted to get some attention here. Maybe move it here instead.. https://stackoverflow.com/questions/38589283/a-faster-route-to-deploying-static-content-in-magento-2-dev-...
1
vote
1answer
395 views

Magento 2 - Conditional Static Block

Is there any way for you to conditionally display a static block? For example, I want a block on the homepage that will only display if there is content in the block. If it is empty, the block ...
1
vote
1answer
114 views

Including newsletter block in a static block issue

I tried to include the newsletter block in a static block content, like: {{block type="newsletter/subscribe" name="newsletter" template="newsletter/subscribe.phtml"}} But it is not working. Can ...
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
1answer
145 views

Refer to static module asset in code

I've added some images to my module eg. view/base/web/images/some-image.png Having run bin/magento setup:static-content:deploy I now see these have been published to the pub directory pub/static/...
1
vote
0answers
303 views

How can I create and update static blocks via a module install script?

I have a number of static blocks and pages I need to create in a few shops and without doing it manually I copied the install script for the sample data for Magento2 to use a .csv to install these ...
5
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 ...
5
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 ...
0
votes
1answer
351 views

Backend Admin 404 not found for jscolor.js

I recently did an upgrade, compile, reindex, flush, clean on my magento 2.0.7 instance. Everything is working fine except on the backend interface I am getting 404 not found on anything in the pub/...
1
vote
1answer
1k views

When I use --clear-static-content and after deploy static content doesn't load any more

I'm using magento 2 and everytime I try to enable a module with --clear-static-content , after I upgrade , clean and deploy , but my static content doesn't load anymore. And when I do deploy , only ...
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 ...
7
votes
3answers
961 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
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 ...
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 ...
1
vote
1answer
966 views

Add static content to product view

I would like add some static text to product views on product-info-main and should be multi language compatible how would I do that? As I understand I can inject static-block content but somehow is ...
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 ...
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 ...
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:...
0
votes
1answer
8k views

Latest css changes not get updated in pub/static folder - magento 2.0.1

I installed magento 2.0.1 and working in developer mode.Now the problem is whenever I change css its not get reflect into pub/static folder . I could refer this Magento2: Re generate css file in pub/...
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. ...
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 ...
0
votes
2answers
376 views

Image won't displayed on front end, but displayed in back end “Static Block”

I was adding static block on my website and insert the image, but the image won't displayed in front end, but in back end "static block" the image was displayed. This is the code : <img alt="...
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"&...
2
votes
1answer
588 views

Magento 2 static deploy en_US argument invalid on XAMPP

I've cloned a working magento 2 repo, done composer install and when I'm trying do do: setup:static-content:deploy I get the error: [InvalidArgumentException] en_US argument has invalid value, please ...
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 ...
31
votes
15answers
115k 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 ...
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
2answers
325 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 ...
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/...
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 ...
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 ...
0
votes
1answer
343 views

ko.getObservable is not a function in admin section

After updating may Magento2 instance to commit I am seeing the error ko.getObservable is not a function in the file events.js. I have performed and composer install, bin/magento update and bin/...