Is there any way to know which cultures
# package-development
p
Is there any way to know which cultures have been published/saved in Umbraco 14? I don't really want to overwrite the Save and publish, Save, Save and preview just to be able to know it 😅
k
In c# you should be able to see what is published from an items 'PublishedCultures' property. I am guessing this does appear somewhere in an items model on the front end too ?
p
Whoops, sorry I should have explained that a bit better. I want to trigger some frontend code the moment that you publish something in the frontend
k
do you mean trigger the frontend (public site) when you publish something in the backoffice (umbraco) ?
p
Trigger something in the backoffice when you publish something in the backoffice 🙂
k
in the backoffice page that has just been published or in everyone's backoffice (e.g another users?) - just trying to work it out.
p
Just for the user that published the page. I have a content app (or workspaceview nowaday) where I want to save some data whenever the user publishes the page
Currently I listen to the
UmbRequestReloadStructureForEntityEvent.TYPE
event coming from the UMB_ACTION_EVENT_CONTEXT as I couldn't find a better solution, but that ofcourse doesn't tell me the cultures
k
if you observe the 'document workspace, 'data') then it will change on a publish, and you can look at the 'variants' property to see if something is published.
Copy code
ts
this.consumeContext(UMB_DOCUMENT_WORKSPACE_CONTEXT, async (context) => {
    this.observe(context.data, (_data) => {
        console.log('workspace data', _data);
    });
});
this will change when something is published, but equally if the publish happens outside of your tab, it will also be loaded when the user moves to your tab after they have published.
p
Interesting. I'll take a look at that. Sounds very promising
n
Hi Patrick, may I ask why you are asking for v.14 and not v.15?
p
Still busy with upgrading my package to v14 😅. And to v15 after that
k
If i was you I wouldn't bother - v14 becomes security updates only in 4 days!
the move to v15 isn't 'too' bad, mainly updating the manifest types and then unless you've done something funky, it should be fine.
p
Ah, I hadn't realized. I might as well go to v15 then
I was thinking the move wouldn't be that bad anyway, so I would also pick up the v14 version