composer custom template

Permalink
Hi all

Not sure where to place this thread so if incorrect place, please move.


i'm using concrete5 5.7

In Composer Form, Edit Form Control, you can add a Custom Template via a select list.

how do I get a Custom Template to show in the select list?

ie Where do I configure that?

Thanks

low tech

lowtech
 
hutman replied on at Permalink Best Answer Reply
hutman
In your /application/blocks directory create a directory with the same name as your block and then create a directory inside there create another one called templates inside this directory add a template_name.php with the view.php code adjusted for what you want to display. The template_name will be shown in the Custom Template menu as Template Name.

So for example if you wanted to add a Rounded Corners option to the Image block you would create this /application/blocks/image/templates/rounded_corners.php and inside that file I would copy everything from /concrete/blocks/image/view.php and adjust as needed.
lowtech replied on at Permalink Reply
lowtech
Hi

Sorry for delay

Very nicely detailed reply. I will give it a try

Much appreciated, really.

low tech
Merlux replied on at Permalink Reply
Similar to the overwrite-mechanism for template, where you add a
templates
directory to your block, you can add templates for the composer field.

This feature seems undocumented, but you can create following structure in your overwrite-block:
overwrittenBlock\composer\myComposerTemplate.php


With that, a new option in the Composer Form Control appears in the select-list for design.

So, a block for a view-template and a corresponding composer-template could look like:
file
   + templates
   └ pdfFile.php
   + composer
   └ pdfComposer.php