Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

First Custom Module Problems
 
AMMoyer
Jr. Member
 
Total Posts:  10
Joined:  2008-08-22
 

I am going through the “Guide to Magento Commerce” tutorial, if you will, about using custom modules.  Everything seems to be fine up to the point where I try to activate the new template and then I get the following error.

WarningMage_Core_Block_Template::include(D:\wamp\www\magento\app\design\frontend\default\default\template\NewProduct/product_view_type_simple.phtml[function.Mage-Core-Block-Template-include]failed to open streamNo such file or directory  in D:\wamp\www\magento\app\code\core\Mage\Core\Block\Template.php on line 144
Trace
:
#0 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Template.php(144): mageCoreErrorHandler(2, 'Mage_Core_Block...', 'D:\wamp\www\mag...', 144, Array)
#1 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Template.php(144): Mage_Core_Block_Template::fetchView()
#2 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Template.php(176): Mage_Core_Block_Template->fetchView('frontend\defaul...')
#3 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Template.php(193): Mage_Core_Block_Template->renderView()
#4 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#5 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Abstract.php(503): Mage_Core_Block_Abstract->toHtml()
#6 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Abstract.php(454): Mage_Core_Block_Abstract->_getChildHtml('product_type_da...', true)
#7 D:\wamp\www\magento\app\design\frontend\default\default\template\catalog\product\view.phtml(62): Mage_Core_Block_Abstract->getChildHtml('product_type_da...')
#8 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Template.php(144): include('D:\wamp\www\mag...')
#9 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Template.php(176): Mage_Core_Block_Template->fetchView('frontend\defaul...')
#10 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Template.php(193): Mage_Core_Block_Template->renderView()
#11 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#12 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Text\List.php(43): Mage_Core_Block_Abstract->toHtml()
#13 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Abstract.php(643): Mage_Core_Block_Text_List->_toHtml()
#14 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Abstract.php(503): Mage_Core_Block_Abstract->toHtml()
#15 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Abstract.php(454): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#16 D:\wamp\www\magento\app\design\frontend\default\default\template\page\2columns-right.phtml(56): Mage_Core_Block_Abstract->getChildHtml('content')
#17 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Template.php(144): include('D:\wamp\www\mag...')
#18 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Template.php(176): Mage_Core_Block_Template->fetchView('frontend\defaul...')
#19 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Template.php(193): Mage_Core_Block_Template->renderView()
#20 D:\wamp\www\magento\app\code\core\Mage\Core\Block\Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#21 D:\wamp\www\magento\app\code\core\Mage\Core\Model\Layout.php(515): Mage_Core_Block_Abstract->toHtml()
#22 D:\wamp\www\magento\app\code\core\Mage\Core\Controller\Varien\Action.php(326): Mage_Core_Model_Layout->getOutput()
#23 D:\wamp\www\magento\app\code\core\Mage\Catalog\controllers\ProductController.php(129): Mage_Core_Controller_Varien_Action->renderLayout()
#24 D:\wamp\www\magento\app\code\core\Mage\Core\Controller\Varien\Action.php(349): Mage_Catalog_ProductController->viewAction()
#25 D:\wamp\www\magento\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(163): Mage_Core_Controller_Varien_Action->dispatch('view')
#26 D:\wamp\www\magento\app\code\core\Mage\Core\Controller\Varien\Front.php(174): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#27 D:\wamp\www\magento\app\Mage.php(447): Mage_Core_Controller_Varien_Front->dispatch()
#28 D:\wamp\www\magento\index.php(52): Mage::run()
I am sure the file name that is called is correct, but if I revert back to the original simple.phtml file all goes back to normal.  Is the problem with my template file itself?  Or am I missing something else?
 
Magento Community Magento Community
Magento Community
Magento Community
 
vianetz
Guru
 
Avatar
Total Posts:  537
Joined:  2008-04-13
Munich, Germany
 

Without saying where you changed what we cannot help…

 
Magento Community Magento Community
Magento Community
Magento Community
 
rrobinson
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2008-05-19
Portland, Or
 

Post your xml that is loading the template.
Post a screenshot from explorer showing the template and directory structure

 
Magento Community Magento Community
Magento Community
Magento Community
 
AMMoyer
Jr. Member
 
Total Posts:  10
Joined:  2008-08-22
 

Here is the section of catalog.xml that I edited to load the template.  If I revert back to the virgin file it doesn’t bomb, but the template obviously doesn’t load either.

<PRODUCT_TYPE_simple>
        <
reference name="product.info">
            <
block type="catalog/product_view_type_simple" name="product.info.simple" as="product_type_data" template="NewProduct/product_view_type_simple.phtml"/>
        </
reference>
    </
PRODUCT_TYPE_simple>

I’ve attempted to attach the screenshot as requested also.  Thanks for your help

Image Attachments
screenshot.JPG
 
Magento Community Magento Community
Magento Community
Magento Community
 
rrobinson
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2008-05-19
Portland, Or
 

Create a Newproduct folder in app/designs/frontend/default/default/templates and copy your template there.

Then magento will be able to find them.

I haven’t read the tutorial so I’m not sure what it’s telling you to do.

I create the design folder in my module hierarchy just to hold the template files for distribution.
I then have to create the directory in the templates folder(above) and copy the phtml files there
when installing the module

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top