Jump to content

Recommended Posts

Posted

The 'global' flag for field is great, untill you don't need that field anymore and you have over 30 templates that have that field assigned...

It looks like you have to manually edit every template and delete the field from there, save, then check the checkbox to confirm?

Is there a way to do this faster?

Thanks.

Posted

That's fun:

foreach($templates as $template){
    foreach($template->fieldgroup as $field){
        if($field->name == "myfield"){
            $template->fieldgroup->remove($field);
            $template->fieldgroup->save();
            echo "deleted $field->name";
        }
    }
}
  • Like 5
Posted

That's fun:

foreach($templates as $template){
    foreach($template->fieldgroup as $field){
        if($field->name == "myfield"){
            $template->fieldgroup->remove($field);
            $template->fieldgroup->save();
            echo "deleted $field->name";
        }
    }
}

I was looking for some something in the Admin, but this works as well... Thanks!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...