• Resolved ominem

    (@ominem)


    Hi, I’m creating a frontend form to add items to my POD, I have this:

    ?$fields = array( ‘post_title’ => array(‘label’ => ‘SME name’),’post_content’ => array(‘label’ => ‘Short description’,’media_buttons’ => ‘false’),’logo_sme’,’region_sme’,’good_practices_sme’,’website_sme’,’email_sme’,’linkedin_sme’,’x_sme’,’facebook_sme’,’instagram_sme’);

    $smes = pods( ‘sme’ );

    echo $smes->form($fields,’Add SME’);

    I want to hide de Add media button and also to limit the post_content characters to 300. Is there a list with all the parameters the ‘post_content’ => array has?

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Paul Clark

    (@pdclark)

    echo pods( 'sme' )->form(
    [
    'post_title' => [ 'label' => 'SME Name' ],
    'post_content' => [
    'label' => 'Short Description',
    'wysiwyg_media_buttons' => false,
    ],
    // ...additional fields...
    ],
    'Add SME'
    );

    WYSIWYG field options, as for post_content are in classes/fields/wysiwyg.php::options(), where static::$type is a placeholder for wysiwyg, so static::$type . '_trim' means the option name is wysiwyg_trim

    I was not able to limit character count in TinyMCE after a few attempts.

    There is a TinyMCE wordcount plugin with an example for notifying at a limit in #8. The challenge is loading the plugin into a frontend context attached to the appropriate editor.

    TinyMCE Advanced / Advanced Editor Tools is an example of one plugin which overrides TinyMCE globally and loads additional plugins, including in frontend Pods form editors. The challenge would be to add the wordcount plugin example and then only activate for the appropriate form editor.

    One may also need to consider the difference between character count as plain text excluding HTML, versus HTML markup.

    Generally, a plain textarea field is much easier to monitor input and restrict character length on — Plain Paragraph Text fields have a Maximum Length option in Pods by default because it is a built-in attribute of HTML textarea fields. TinyMCE is not a text area —?it’s an HTML document in editable mode within an iFrame with various scripts modifying its behavior.

    Thread Starter ominem

    (@ominem)

    Thank you, I will look into it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.