Add a custom template by default

Permalink
Hey there,
I have hunted around for this and found some response but not an answer as yet.

Is there any way to add a custom template by default. I know you can edit the default view.php but I do not want to apply it to everything, sitewide. Just when you add an image to a certain template.

Thanks

dancer
 
hutman replied on at Permalink Reply
hutman
Could you give a little more information about this. Are you adding these images through the CMS by adding a block manually to the page, or are you adding it by code somehow (ProEvents or another Add-On)?

If it is being added to the page by another Add-On or something you can add this code to your area in your page type and it will by default add the Custom Template (this does not load the view.css, only the view.php):

<?php
$a = new Area('Main');
$a->setCustomTemplate('block_type', 'templates/template_folder/');
$a->display($c);
?>


If the image is being added to the area manually I'm not sure if this will work.
dancer replied on at Permalink Reply
dancer
Hey there,

Thanks for the response. I will be adding the image manually via the CMS,
therefore I believe your solution is the one I am looking for. I will give
it a go when I am home tonight. Many thanks