GetChild Html метод, возвращающий пустую строку для блока заголовка - Magento 1.9 - PullRequest
1 голос
/ 06 августа 2020

Я пытался перенести существующий проект magento 1.9 на сервер ec2, все остальное вместе с панелью администратора настроено правильно, но head.phtml не загружается, а this->getChildHtml('head') возвращает пустую строку.

Стр. xml

<block type="page/html" name="root" output="toHtml" template="page/1column.phtml">

        <block type="page/html_head" name="head" as="head">
            <action method="addJs"><script>prototype/prototype.js</script></action>
            <action method="addJs"><script>lib/ccard.js</script></action>
            <action method="addJs"><script>prototype/validation.js</script></action>
            <action method="addJs"><script>scriptaculous/builder.js</script></action>
            <action method="addJs"><script>scriptaculous/effects.js</script></action>
            <action method="addJs"><script>scriptaculous/dragdrop.js</script></action>
            <action method="addJs"><script>scriptaculous/controls.js</script></action>
            <action method="addJs"><script>scriptaculous/slider.js</script></action>
            <action method="addJs"><script>varien/js.js</script></action>
            <action method="addJs"><script>varien/form.js</script></action>
            <action method="addJs"><script>varien/menu.js</script></action>
            <action method="addJs"><script>mage/translate.js</script></action>
            <action method="addJs"><script>mage/cookies.js</script></action>

            <action method="addItem"><type>skin_js</type><name>js/jquery-1.12.1.min.js</name></action>
            <action method="addItem"><type>skin_js</type><name>js/jquery-migrate-1.3.0.min.js</name></action>
            <action method="addItem"><type>skin_js</type><name>js/jquery-noconflict.js</name></action>
            <action method="addItem"><type>skin_js</type><name>codazon/bootstrap/js/bootstrap.min.js</name></action>
            <!--<action method="addItem"><type>skin_js</type><name>js/snowfall.jquery.min.js</name></action>-->
            <action method="addItem"><type>skin_js</type><name>js/theme.js</name></action>
            <block type="core/template" name="cdz_custom_head" template="page/html/cdz_custom_head.phtml" />
            <block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>
            
            <action method="addItem"><type>skin_css</type><name helper="themeframework/bootstrapCssFile"/></action>
            
            <action method="addItem"><type>skin_css</type><name>css/fontawesome/font-awesome.min.css</name></action>
            <action method="addItem"><type>skin_css</type><name>codazon/bootstrap/css/bootstrap-theme.min.css</name></action>
            <action method="addCss"><stylesheet>css/styles.css</stylesheet></action>
            <action method="addCss"><stylesheet>css/responsive.css</stylesheet></action>
            <action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name><params/><if>lt IE 8</if></action>
            <action method="addCss"><stylesheet>css/widgets.css</stylesheet></action>
            <action method="addCss"><stylesheet>css/print.css</stylesheet><params>media="print"</params></action>
            <action method="addItem"><type>skin_js</type><name helper="themeframework/sliderJsFile" /></action>
            <action method="addItem"><type>skin_css</type><name>codazon/owl.carousel/owl.carousel.min.css</name></action>
            <action method="addItem"><type>skin_css</type><name>codazon/owl.carousel/owl.theme.default.min.css</name></action>
            <action method="addItem"><type>skin_js</type><name>codazon/jasny-bootstrap/jasny-bootstrap.min.js</name></action>
            <action method="addItem"><type>skin_css</type><name>codazon/jasny-bootstrap/jasny-bootstrap.min.css</name></action>
            <action method="addItem"><type>skin_js</type><name>js/lib/modernizr.custom.min.js</name></action>
            <!--action method="addItem"><type>skin_js</type><name>js/lib/selectivizr.js</name></action>
            <action method="addItem"><type>skin_js</type><name>js/lib/matchMedia.js</name></action>
            <action method="addItem"><type>skin_js</type><name>js/lib/matchMedia.addListener.js</name></action-->
            <action method="addItem"><type>skin_js</type><name>js/lib/enquire.js</name></action>
            
            
            <action method="addItem"><type>skin_js</type><name>js/app.js</name></action>
            <!--action method="addItem"><type>skin_js</type><name>js/lib/jquery.cycle2.min.js</name></action>
            <action method="addItem"><type>skin_js</type><name>js/lib/jquery.cycle2.swipe.min.js</name></action>
            <action method="addItem"><type>skin_js</type><name>js/slideshow.js</name></action-->
            
            
            
            <action method="addItem"><type>js</type><name>lib/ds-sleight.js</name><params/><if>lt IE 7</if></action>
            <action method="addItem"><type>skin_js</type><name>js/ie6.js</name><params/><if>lt IE 7</if></action>
            
            <action method="addItem"><type>skin_css</type><name>css/animate.min.css</name></action>
        </block>

1колонка.p html

<head>
    <?php echo( $this->getChildHtml('head') )?>
</head>

As we can see in image below ,Head tag is not rendered.

введите описание изображения здесь

Спасибо.

Ответы [ 2 ]

2 голосов
/ 02 сентября 2020

Попробуйте следующее:

<head>
    <?php echo $this->getChildHtml('head') ?>
</head>
1 голос
/ 02 сентября 2020

Я решил проблему, завершив удаление модуля GTSPEED из проекта, так как это каким-то образом ограничивало загрузку head.p html правильно.

...