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

repeater field is bugged after installing this plugin #25

Open
raakesh opened this issue Aug 22, 2016 · 2 comments
Open

repeater field is bugged after installing this plugin #25

raakesh opened this issue Aug 22, 2016 · 2 comments

Comments

@raakesh
Copy link

raakesh commented Aug 22, 2016

After installing this plugin the repeater is not working as it should be, meta tag fields of this plugin are also repeating with the fields of the repeater.

{repeater name="content_sections" prompt="Add More"} <h2>{text name="title" label="Title"}Title{/text}</h2> {/repeater}

After installation
https://www.dropbox.com/s/ezjuiu1lj8bqnu1/after-installation.png?dl=0

Before installation
https://www.dropbox.com/s/g3hxnrusd2ux4i0/before-installation.png?dl=0

@MarpoOcknew
Copy link

MarpoOcknew commented May 11, 2018

This is something I've noticed is still happening. Its a simple fix for it but you can hide the extra fields with this css. Just add it to the backend additional css tab in october.

.field-repeater-form div[data-field-name="viewBag[seo_title]"],
.field-repeater-form div[data-field-name="viewBag[seo_description]"],
.field-repeater-form div[data-field-name="viewBag[seo_keywords]"],
.field-repeater-form div[data-field-name="viewBag[canonical_url]"],
.field-repeater-form div[data-field-name="viewBag[redirect_url]"],
.field-repeater-form div[data-field-name="viewBag[robot_index]"],
.field-repeater-form div[data-field-name="viewBag[robot_follow]"] {
    display: none;
}

@d-nightmare
Copy link

Instead of hiding it, this small check gets rid of them completely as arrayName only gets populated within the repeater:

 if(PluginManager::instance()->hasPlugin('RainLab.Pages') && $widget->model instanceof \RainLab\Pages\Classes\Page)
            {
                // skip adding meta fields for repeater-fields
                if(!is_null($widget->arrayName)) { return; };

                $widget->addFields([.....

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

3 participants