Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Custom form field template


Go to End


1622 Views

Avatar
Chimera

Community Member, 10 Posts

12 August 2013 at 4:45am

Hi,

i want to render form field with custom template like its described in documentation, but it doesent work.

This is my field:
$field = OptionsetField::create('filter_type', 'filter_type', array("" => "Prodej", "rent" => "Pronájem"));
$field->setTemplate('PropertyOptionsetField');
$field->setFieldHolderTemplate('PropertyOptionsetField');
$fields->add($field);

And templates are in this paths :
\themes\simple\templates\Includes\filter\fields
\mysite\templates\fields

Any suggestions ? Thanks.