Use a plugin defined field inside template

by thednp   Last Updated May 13, 2019 19:10 PM - source

I've created a custom field for my plugin and it's working great, but if I want to use the same field within my templateDetails.xml I get an almost blank page in the template style edit page. I should probably mention that my getInput() methods loads no layout, it simply returns an <input> with a bunch of attributes.

Here's my templateDetails.xml part

<fieldset name="advanced" label="Some FIELDSET NAME" 

        label="SOME LABEL"
        hint="Some hint"

The console say: Failed to load resource: the server responded with a status of 500 (Internal Server Error)

The page title says Error: 0 Call to undefined function random()

Is there something wrong here or am I missing something with my field?

Tags : custom-field

Answers 1

Found the problem, I want to always use an ID for my fields to make sure they are unique for JavaScript initialization, so I misspelled rand() for random(), so while all my custom field instances were using an ID in the templateDetails.xml file, I couldn't figure out what's going on.

May 14, 2019 08:31 AM

Related Questions

Default value for repeatable custom field

Updated July 23, 2019 17:10 PM

Custom form field not working on server

Updated April 26, 2017 10:10 AM