I have created a module where I can add images in the admin and then they will be displayed in the front-end in the form of a banner slider.
all of my admin stuff is working fine it adds images etc etc, so I created a block (/app/code/local/Nublue/Slidemanager/Block/bannerslider.php) which consists of the following:
public function CreateSliderHtml()
{
$html = '';
$slideimage = Mage::getModel('nublue_slidemanager/slideimage');
foreach ($slideimage as $slide) {
$image = $slide->getImage();
if ($slide->getUrl() != null || '') {
$url = $slide->getUrl();
}
$html .= '<li><img src="'$image'" href="' if (isset($url)){'$url"'} 'width="600" height="400" alt=""></li>'
}
return $html;
}
}
and my class is called 'Nublue_Slidemanager_Block_bannerslider' and it extends 'Mage_Core_Block_Template'
in my template file
(app/design/frontend/base/default/template/Nublue_Slidemanager/bannerslider.phtml)
I have this:
<!-- Carousel -->
<div class="jcarousel">
<ul>
<?php echo $this->CreateSliderHtml(); ?>
</ul>
</div>
but the echo $this->CreateSliderHtml(); gives an error
Invalid method Mage_Core_Block_Template::CreateSliderHtml(Array ( ) )
and I know the template file is being called because if I remove the php code from the template and hardcode some images then they show up.
Is there an xml file I need to edit somewhere? I thought as long as I defined where I was getting blocks and helpers and things from it would work. So to clarify I do have Nublue_Slidemanager.xml and config.xml in their correct folders