We have a project in Umbraco Cloud utilising baselines. Basic simple structure at the moment, nothing outside the ordinary.
We've added a field to a doc type, a checkbox, by design this has a default value of true in order to show an element on a page.
The site in question has, ~20 nodes that utilise this field. However it requires that EACH node is published (full, save and publish, republishing entire site does nothing).
My issue is, I shouldn't have to manually re publish every single node in order for this to apply. Not to mention there may end up being 'n' number of sites inheriting the baseline.
In short then, am I doing something wrong? is there a way to 'fully' republish everything? Would I need to build an endpoint that does this for each site in the baseline set up and link to the deploy webhook?
Just looking for ideas on how anyone else is handling things like this. Thanks,
Luke
This is a problem with adding a checkbox property to a doc type that's already in use. The default value that you configure on the data type only tells the editor to default the box to checked or unchecked when editing a new node. Any existing nodes have no value stored for the new property until you save and publish them, and templates will interpret that missing value as false.
Although it won't always be an acceptable workaround, I tend to handle it by just naming the new property in a way that makes the default value false. If pages should be shown in the menu by default, name the property "Hide in menu" rather than "Show in menu".
Another option could be adding a custom PropertyValueConverter which does respect the configured default value. Fixing the problem in the standard PropertyValueConverter could be a nasty breaking change for upgrades since people could be relying on the current behaviour, but that's not a problem in your own sites when you know what to expect.
New doc type field not published
Hi guys,
We have a project in Umbraco Cloud utilising baselines. Basic simple structure at the moment, nothing outside the ordinary.
We've added a field to a doc type, a checkbox, by design this has a default value of true in order to show an element on a page.
The site in question has, ~20 nodes that utilise this field. However it requires that EACH node is published (full, save and publish, republishing entire site does nothing).
My issue is, I shouldn't have to manually re publish every single node in order for this to apply. Not to mention there may end up being 'n' number of sites inheriting the baseline.
In short then, am I doing something wrong? is there a way to 'fully' republish everything? Would I need to build an endpoint that does this for each site in the baseline set up and link to the deploy webhook?
Just looking for ideas on how anyone else is handling things like this. Thanks, Luke
This is a problem with adding a checkbox property to a doc type that's already in use. The default value that you configure on the data type only tells the editor to default the box to checked or unchecked when editing a new node. Any existing nodes have no value stored for the new property until you save and publish them, and templates will interpret that missing value as false.
Although it won't always be an acceptable workaround, I tend to handle it by just naming the new property in a way that makes the default value false. If pages should be shown in the menu by default, name the property "Hide in menu" rather than "Show in menu".
Thanks Steve,
I see, that's quite annoying but makes sense.
We can probably invert our logic to work around this but as you sat that's not always acceptable.
Thanks again for your prompt response,
Luke
Another option could be adding a custom PropertyValueConverter which does respect the configured default value. Fixing the problem in the standard PropertyValueConverter could be a nasty breaking change for upgrades since people could be relying on the current behaviour, but that's not a problem in your own sites when you know what to expect.
is working on a reply...