Closed pzmarzly closed 4 years ago
Why is a reload needed?
For my use case, I'm changing nova theme by putting
<style>
:root {
--primary: {{ nova_get_setting('primary_color') ?? '#aabbcc' }};
--secondary: {{ nova_get_setting('secondary_color') ?? '#ddeeff' }};
}
</style>
to my resources/views/layouts/partials/theme.blade.php
file.
But I suspect there are other aspects of Nova that can be customized but require a full page reload (maybe enabling/disabling an item in the sidebar?).
Hey! Added a config file with reload_page_on_save
option in version 2.4.0. Good luck!
I use Nova Settings for color fields, to let admins control their site appearance (including Nova, via CSS variables and
timothyasp/color
). But since Nova is a SPA, I'd need to somehow executelocation.reload()
after the form is saved, ideally somewhere around here:https://github.com/optimistdigital/nova-settings/blob/cba4c547c4df1fe0d323a3547ae39abe45d92306/resources/js/views/Settings.vue#L81-L94
I can't think of any useful hooks on JS side other than the reload one, but maybe someone will want PHP hooks one day (for dropping caches after settings are saved, etc.).