How would I (in Concrete 5 5.7) Force a Specific Block to use a Custom Template?

Permalink
Hi all,

I hope you can help with a problem.

I have a specific editable area ($a) within which I would like all image blocks to default to a custom image template - but only image blocks in that area, not globally.

I've tried

$a= new Area('Product Images');
$a->setBlockLimit(4);
$a->setCustomTemplate('image', 'templates/product_thumbnail_image.php');


but this does not cause the image blocks to default to the template found at /application/blocks/image/templates/product_thumbnail_image.php

I have tried to follow the guidance in the documents but this is not working for me.

Can someone help me achieve this?

 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi Ambulare,

You left out "$a->display($c);".

Was that a typo?

$a = new Area('Product Images');
$a->setBlockLimit(4);
$a->setCustomTemplate('image', 'templates/product_thumbnail_image.php');
$a->display($c);
Ambulare replied on at Permalink Reply
Hello, yes I left that off just to save space, it is present in the real code.