MichaMichaMicha Posted June 10, 2013 Share Posted June 10, 2013 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. Link to comment Share on other sites More sharing options...
Soma Posted June 10, 2013 Share Posted June 10, 2013 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"; } } } 5 Link to comment Share on other sites More sharing options...
MichaMichaMicha Posted June 10, 2013 Author Share Posted June 10, 2013 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now