spicywebau / craft-fieldlabels

Override Craft CMS field labels and instructions in the field layout designer
MIT License
123 stars 9 forks source link

Transition to Craft 3.5 native relabelling #54

Closed ttempleton closed 4 years ago

ttempleton commented 4 years ago

The overhauled Craft 3.5 field layout designer features in-built overriding of field names and instructions. We will need to provide a transition path to Craft 3.5 field relabelling for current users of Field Labels.

ttempleton commented 4 years ago

Completed in Field Labels 1.3.0.

bertoost commented 4 years ago

Too bad.. In 3.5 you're not able to hide field labels or instructions. This was a great feature. Sometimes I have a tab with just one matrix field, then a field-label is not necessary and I always remove them with the plugin.

[edit] Apparently this could be done by using __blank__. https://github.com/craftcms/cms/issues/6608#issuecomment-672337354

bertoost commented 4 years ago

Also the provided migration is not triggering the project-config resave.. so when deploying a project, the re-labeled labels are gone :-(

[edit] I used this temporary code to re-save the entry types and re-generate new project config files

$service = \Craft::$app->getSections();
$entryTypes = $service->getAllEntryTypes();

foreach ($entryTypes as $entryType) {
        $service->saveEntryType($entryType);
}
ttempleton commented 4 years ago

@bertoost Thanks for pointing out using __blank__ to hide a label! Unfortunately it doesn't seem to work with instructions, though, but Field Labels 1.3.1 will reset labels to __blank__ if the label was set to be hidden with Field Labels. It also resolves the project config issue by rebuilding it. Anyone reading this who's already uninstalled Field Labels, manually rebuilding the project config should work as well.