0

I created a new Template based on the Blanco/Luma theme as pointed out in several howto's as in this topic)

Strange thing is that the css and the products (and images) which are available do not load in frontend. So I end up with just plain text. I tried all solutions mentioned like deleting the static files, running php bin/magento setup:static-content:deploy and made sure the permission on the files are ok.

This is how my frontend html looks like:

<code>
!doctype html>
<html lang="nl-NL">
    <head >
        <script>
    var require = {
        "baseUrl": "http://site1/pub/static/frontend/MyTemplate/menes1-theme/nl_NL"
    };
</script>
        <meta charset="utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="description" content="Default Description"/>
<meta name="keywords" content="Magento, Varien, E-commerce"/>
<meta name="robots" content="INDEX,FOLLOW"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Home page</title>
<link  rel="stylesheet" type="text/css"  media="all" href="http://site1/pub/static/frontend/MyTemplate/menes1-theme/nl_NL/mage/calendar.css" />
<link  rel="icon" type="image/x-icon" href="http://site1/pub/static/frontend/MyTemplate/menes1-theme/nl_NL/Magento_Theme/favicon.ico" />
<link  rel="shortcut icon" type="image/x-icon" href="http://site1/pub/static/frontend/MyTemplate/menes1-theme/nl_NL/Magento_Theme/favicon.ico" />
<script  type="text/javascript"  src="http://site1/pub/static/frontend/MyTemplate/menes1-theme/nl_NL/requirejs/require.js"></script>
<script  type="text/javascript"  src="http://site1/pub/static/frontend/MyTemplate/menes1-theme/nl_NL/mage/requirejs/mixins.js"></script>
<script  type="text/javascript"  src="http://site1/pub/static/_requirejs/frontend/MyTemplate/menes1-theme/nl_NL/requirejs-config.js"></script>
            </head>
    <body data-container="body" data-mage-init='{"loaderAjax": {}, "loader": { "icon": "http://site1/pub/static/frontend/MyTemplate/menes1-theme/nl_NL/images/loader-2.gif"}}' class="cms-home cms-index-index page-layout-1column">
</code>

So it looks like all the files are available in the static folder? Why are they not loaded? When using the Luma theme, the products and css are loaded without any problem? I have all the files in place for the template to work (as in the sample mentioned). Only thing I did not get form that sample was where the mentioned config has to go? In all other howto's I found there was no config mentioned so maybe that might be the problem? I do not have Grunt running on my server. Since the final production server on a hosted environment does not has that available.

Any hints on how to get this right? Magento version is 2.09

  • Ok made some progress. I emptied the cache which was kept by the server rm -R /tmp/magento/var/cache/* That made at least my BE working again and also showed me some new errors on the front end. <code> – mr_typo3 Sep 19 '16 at 12:45
  • Ok made some progress. I emptied the cache which was kept by the server rm -R /tmp/magento/var/cache/* That made at least my BE working again and also showed me some new errors on the front end. <code>Notice: getimagesize(): Read error! in /var/www/www.site1/www/vendor/magento/module-catalog/Model/Product/Image.php on line 949</code> But looking at that file (Image.php) it is not there? Only Cache.php ? – mr_typo3 Sep 19 '16 at 12:55
  • Had a look in the log files and it says: [2016-09-19 13:35:03] main.INFO: Cache file with merged layout: LAYOUT_adminhtml_STORE2_331b80c99f1d265b3f83441bdff2abf85: Please correct the XML data and t$ [2016-09-19 13:35:03] main.CRITICAL: Broken reference: the 'global_notices' element cannot be added as child to 'global.notices', because the latter doesn't$ [2016-09-19 13:35:03] main.CRITICAL: Broken reference: the 'logo' element cannot be added as child to 'header', because the latter doesn't exist So what does that mean? It can't find some parts? What xml file is referred to? – mr_typo3 Sep 19 '16 at 17:50
  • Anyone who can help sorting out this error? Saw that there was already a post about this in 2015. Which was closed, with the result that it was solved in newer version of Magento 2.0. But apparently it is still there? Strange thing is though that I do not have any error when loading the Luma or Blanco Template. Than products are shown as well as the images! So where to look for this strange behaviour? – mr_typo3 Sep 20 '16 at 12:25
  • To be sure I did not mess things up, I will start over again and create a new theme from scratch. Will it help copying over the /vendor/magento/theme-fronted-luma and use that as my base for creating a new frontend-theme? – mr_typo3 Sep 21 '16 at 8:47
0

Please add your css file in the page.xml of the App/design/frontend/yourtheme/default/layout/page.xml add the css file as follow,

<action method="addCss"><stylesheet>css/yourfilename.css</stylesheet></action>

CSS file should located to the skin/frontend/yourtheme/default/css/

  • I think that applies to Magento 1.9 isn't it. In Magento 2.* There is no Dir skin/frontend .... – mr_typo3 Sep 19 '16 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.