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

Error: TinyMCE Buttons on repeatable Sections #100

Closed
patrickf0 opened this issue Apr 28, 2014 · 3 comments
Closed

Error: TinyMCE Buttons on repeatable Sections #100

patrickf0 opened this issue Apr 28, 2014 · 3 comments

Comments

@patrickf0
Copy link

When you repeat a section with an RichTextEditor in it, the TinyMCE buttons are empty (see image below).

Besides a reload of the page solves the problem.

bildschirmfoto 2014-04-28 um 15 32 13

 $this->addSettingSections(
        array(
            'section_id'    =>  'slider',
            'repeatable'    =>  array(
                'max'   =>  5,
                'min'   =>  1,
            ),
        )
    );


    $this->addSettingFields(
        array(
            'field_id'      =>  'slider_text',
            'section_id'    =>  'slider',
            'title'         =>  'Slidertext',
            'type'          =>  'textarea',
            'rich'          =>  true
        ),
        array(
            'field_id'              =>  'slider_image',
            'section_id'            =>  'slider',
            'title'                 =>  'Teaser Icon',
            'description'           =>  'Format: max. 410 x 510px',
            'type'                  =>  'image',
            'attributes_to_store'   =>  array( 'alt', 'id', 'title' ),
            'attributes'    => array(
                'preview'   => array(
                    'style' => 'max-width:200px;'
                ),
            ),
        )
    );
@michaeluno
Copy link
Owner

Yeah. The rich text editor is not supported for repeatable fields as well as some other custom field types that rely on jQuery. The problem is that I have not found a solution for it.

If you know a way and can suggest some code, it would be appreciated. I've found this article and it may help: http://www.kathyisawesome.com/426/multiple-wordpress-wysiwyg-visual-editors/

@michaeluno
Copy link
Owner

I've been working on this enhancement and made it almost done except quick tags. I could only make TinyMCE editors repeatable. It seems quick tags cannot be repeated as reported here.

@michaeluno
Copy link
Owner

Updated the 3.1.6b branch: https://github.com/michaeluno/admin-page-framework/tree/3.1.6b
Download. https://github.com/michaeluno/admin-page-framework/archive/3.1.6b.zip

It supports repeating TinyMCE editors. However, it still has a problem with repeating WordPress Quick Tags. What I did was simply remove the element holding quick tags if the field is repeated.

Also, it includes a change that affects the behavior of repeating form sections. So anybody using repeatable sections, please test it if it does not break anything.

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

No branches or pull requests

2 participants