How to set a Custom Template by hardcode for an Area:

Permalink 1 user found helpful
Hi,
I try alot but not succeded, for setting a custom template for an area by hardcode for specific blocks in that area.
I am using this code for setting custom template....
<?php
            $block = BlockType::getByHandle('easynews_list');
                                $a=new Area('All News Area');
            var_dump($block);exit;
            $a->setCustomTemplate($block, 'all_news');
                                $a->display($c);
                            ?>


Any one know about it????

 
TheRealSean replied on at Permalink Best Answer Reply
TheRealSean
<?php
            $a=new Area('All News Area');
            $a->setCustomTemplate('easynews_list', 'templates/all_news.php');
//or
//$a->setCustomTemplate('easynews_list', 'templates/all_news/view.php');
            $a->display($c);
?>