1

Having an issue with a custom module I have just built.

It's quite simple nothing heavy, but one day it outputted fine and now I get nothing whatsoever! It's driving me nuts!

EDIT

Here the module is on github in its entirety. The module has 2 bits of functionality, a simple custom widget with a phtml file to display videos on any of the widget hooks provided in magento. And the ability to add videos to products and to display them on the product page.

The module seems to install correctly etc, and i can see it in admin, but for some reason when adding a video to the product or adding a new video widget there is no output,

Any help will be much appreciated

5
  • yes, can you include other files that output your intended result? Commented Jun 18, 2015 at 23:14
  • your codes seems perfectly okay and that is why you can see your module in backend. So obviously the problem resides in other files. Please include those files and also describe what you are really struggling with your extension Commented Jun 19, 2015 at 1:58
  • 4
    I'm voting to close this question as off-topic because this question seems to be incomplete. In order to make the question valid, please add more files to your question and describe what is the real problem that you are facing specifically. Commented Jun 19, 2015 at 2:00
  • @RajeevKTomy I have updated the question with a github link and some more details, i hope this is satisfactory, cheers
    – Tom Burman
    Commented Jun 19, 2015 at 7:04
  • @TomBurman I made a pull request to your repo. Please find it and try again. Commented Jun 19, 2015 at 8:05

2 Answers 2

2

SYMLINKS!!!!!

Totally forgot to allow symlinks in the adminhtml like a douchebag! So simple, yet so easily forgotten.

Where i am using modman to symlink my files into the project, without having symlinks allowed, the templates will not be outputted!

Cheers for all help

1

You called your custom video block with it's name from product.info.media block. It is wrong. Instead you need to set an alias name for your custom video block and then refer with alias name inside product.info.media block.

So the changes will look like this.

File : app/design/frontend/base/default/layout/justtom/videos.xml

<?xml version="1.0"?>
<layout>
    <catalog_product_view>
        <reference name="product.info.media">
            <action method="setTemplate">
                <template>justtom/videos/product/view/media.phtml</template>
            </action>
            <block type="core/template" name="product.info.media.video" as="product_info_media_video" template="justtom/videos/product/view/video.phtml"/>
        </reference>
    </catalog_product_view>
</layout>

See the alias name set with as="product_info_media_video" to your block. Now you need to refer by this alias name inside product.info.media block.

File : app/design/frontend/base/default/template/justtom/videos/product/view/media.phtml

<?php $this->getChild('product_info_media_video')->setProduct($_product);?>
<?php echo $this->getChildHtml('product_info_media_video'); ?>

Done. Clear the cache and load the page again. Most probably you can see the result, if you set up your widget correctly.

1
  • Thanks for the answer and the effort, but this did not solve the issue. Using Magento community 1.8.1.0
    – Tom Burman
    Commented Jun 19, 2015 at 12:39

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