I want my custom block to be dependent on whether my module is enabled or not and I want do not want it to be dependent on a theme so using the following, for example, is out of the question: /catalog/product/view.phtml - using getChild().
I am attempting to add a block to product.info. I can update the product page without modifying any default template files if I use but, of course, if I use....
<reference name="product.info">
I cannot show it unless I add a getChild() method to /catalog/product/view.phtml.
Module config.xml
<?xml version="1.0"?>
<config>
<modules>
<Importer_Nutrition>
<version>0.1.5</version>
</Importer_Nutrition>
</modules>
<global>
<models>
<nutrition>
<class>Importer_Nutrition_Model</class>
</nutrition>
</models>
</global>
<frontend>
<routers>
<nutrition>
<use>standard</use>
<args>
<module>Importer_Nutrition</module>
<frontName>nutrition</frontName>
</args>
</nutrition>
</routers>
<!-- Establish Layout Rules -->
<layout>
<updates>
<nutrition>
<file>Importer/Nutrition/product_view.xml</file>
</nutrition>
</updates>
</layout>
</frontend>
<crontab>
<jobs>
<Importer_Fetch_Nutrition_Info>
<schedule>
<cron_expr>0 2 1,5 * *</cron_expr>
</schedule>
<!-- Stocks are being added to database every 30 minutes at H:01 and H:31
it can take up to 5 minutes to finish, so we are waiting ten minutes after each import -->
<run>
<model>nutrition/Fetchnutritioninfo::run</model>
</run>
</Importer_Fetch_Nutrition_Info>
</jobs>
</crontab>
</config>
[theme]/layout/Importer/Nutrition/product_view.xml
<layout version="0.1.0">
<catalog_product_view translate="label">
<reference name="product.info">
<block type="catalog/product_view_description" name="product.nutritionLabel" after="product.description" template="Importer/Nutrition/catalog/product/view/nutritionLabel.phtml" />
</reference>
</catalog_product_view>
Can I use an observer to accomplish this?