wysiwyg Uploads

4 posts by 3 authors in: Forums > CMS Builder
Last Post: September 18, 2019   (RSS)

By moh3 - September 4, 2019 - edited: September 4, 2019

Dear CMS builder i'm trying to enable uploads for an wysiwyg editor but i get an error Field 'test' isn't an upload field! although i check the box to enable the uploads can you please help

thanks

By moh3 - September 17, 2019

hello thank you for your answer actually i defined a new field type to have it available in the cms do i need to define uploads for that new field type? i copied the WYSIWYG field code and renamed it to something else

By daniel - September 18, 2019

Hi moh3,

Defining entirely new field types can be a complex task, though I can point you at the location of your specific error. In /cmsb/lib/menus/default/uploadForm_functions.php there is a line:

  if ($schema[$fieldname]['type'] != 'upload' && $schema[$fieldname]['type'] != 'wysiwyg') { die("Field '" .htmlencode($fieldname). "' isn't an upload field!"); }

Which would need to be modified to include your new field type, something like this:

  if ($schema[$fieldname]['type'] != 'upload' && $schema[$fieldname]['type'] != 'wysiwyg' && $schema[$fieldname]['type'] != 'newtype') { die("Field '" .htmlencode($fieldname). "' isn't an upload field!"); }

However, I can't guarantee that this will be the only roadblock you encounter; there may be other places in the code that require similar modifications. I'll also caution that making changes to core CMSB files like this isn't generally recommended, as it is difficult for us to support, and can be overwritten when upgrading.

If you can describe what you're trying to do with this new field, I can try to help think of an alternate solution - if you're interested!

Cheers,

Daniel
Technical Lead
interactivetools.com