Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to provide custome field template? #6

Open
sinan-evanshunt opened this issue Aug 31, 2020 · 0 comments
Open

How to provide custome field template? #6

sinan-evanshunt opened this issue Aug 31, 2020 · 0 comments

Comments

@sinan-evanshunt
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant