Skip to content

How to provide custome field template? #6

@sinan-evanshunt

Description

@sinan-evanshunt

Any idea how to provide a custom field template. The only way I can right now is to duplicate the AdvancedDropdownField.ss template and place it under mysite/templates/forms/AdvancedDropdownField.ss but I don't want this customization to be a global change, I would like to use a specific template for this field with LinksDropdownField

My custom field is:
mysite/code/extensions/LinksDropdownField.php

class LinksDropdownField extends EditableDropDown
{
// more code here
public function getFormField()
    {


		$field = new AdvancedDropdownField($this->Name, $this->EscapedTitle, $this->optionsList());
	   	$field->setTemplate('LinksDropdownField');


		$this->doUpdateFormField($field);
        return $field;
	}
}

Any help is appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions