Every week I realize what a wealth of information gets shared in the Umbraco Discord and the many things I might want to look up again later, so I've started keeping a list!
CORS
How to modify CORS on Umbraco netcore, asks Sean.
My teammate Paul has the answer:
services.Configure<UmbracoPipelineOptions>(opt => {
opt.AddFilter(new UmbracoPipelineFilter("cors")
{
PostPipeline = app => app.UseCors(cors =>
{
cors.AllowAnyMethod() // for example
.AllowAnyHeader() // for example
.AllowAnyOrigin(); // for example
})
});
});
Should just be able to do this in configure services (or a composer etc)
Modelsbuilder
Heather made me check out Limbo Modelsbuilder:
While, by the way, Sean is plugging his upcoming Codegarden talk about building the Aardman website on Umbraco.
Heather notes that much of the Modelsbuilder functionality that was available in the v8 Visual Studio extension is now again available in this package.
Element types and tags
Søren blogged about bypassing (some) of our limitations when trying to use certain property editors in nested content / block editor.
While Lee also points out that his wonderful Contentment package can use the data from property editors like the Tags editors.
Lee also noted during UmbraCollab that Contentment already works with Umbraco 10, he has an alpha release out now!
UmbraCollab
As you may or may not know, every Thursday at 13:00 CET we get together on Discord and do a bit of mob programming. This week we tried to do some Umbraco 10 upgrades.
Paul kicked off with what was going to be an attempt to upgrade his Portfolio Starter Kit and Examine Content App to Umbraco 10. Turns out both of those "just" worked on v10 already, so there was really nothing to do, excellent!
Then I tried to upgrade my blog to v10 and ran into some problems, similar problems happened on a different test site I had laying around and it turns out I forgot to upgrade the sites to .NET 6 - after which everything just worked, smooth. Thanks Bjarke for the hint and for providing the updated docs.
The recording is on YouTube:
Redis
Gareth wrote a blog post about caching Umbraco content in Redis after getting some feedback.
Setting properties to read-only
Harry asked about making some properties read-only under certain conditions.
And Paul Seal reminds us of Marc Goodson's blogpost about his attempts at limiting editor access by language.
Vite
Dan Hammond has been on a journey this week to get Vite to load in the backoffice and eventually seems to have gotten there with a bit of help from Nathan and by orchestrating a big hack.
He notes:
In the loader:
const ready = $.prototype.ready;
let queued = [];
$.prototype.ready = function ( fn ) {
queued.push( fn );
};
$.enableReady = function() {
queued.forEach((x) => {
ready.call(this, x);
})
$.prototype.ready = ready;
}
let script = document.createElement("script");
script.type = "module";
script.src = "/backoffice/src/main.ts";
document.getElementsByTagName('head')[0].appendChild(script);
In my Vite script:
if ( $.enableReady ) {
$.enableReady()
}
Visual Studio code cleanup
Lastly, Matt Wise shared a useful link for those not yet using Rider.
Automatic code cleanup on saving a file is coming to Visual Studio at last.
That's a wrap!
Wow, that was a lot going on in just a single week! Hard to keep up.
As always, you're welcome to join us and collaborate on anything you're working on in Umbraco at the moment. Or just lurk, as you can see there's a lot to learn from.
UmbraCollab opportunity 💡
As a final note:
We are always looking for people to join us on UmbraCollab. Thursday at 13:00, strictly limited to one hours of collaborating on something. Topics can include:
- working on a pull request
- working on a new package
- converting existing packages to a newer version
- trying out new (or old) features in Umbraco
You drive the screen and we help you out with helpful (and sometimes completely useless) comments. Usually we get pretty far in an hour and most of all we all learn something new.
Tweet me, DMs are open 👋, if you would like to take the opportunity and share something interesting!
Top comments (1)
This is a fantastic initiative!