Is it actually possible to make a
# package-development
r
Think conditions are and instead of or? You could create a custom condition that checks for both sections maybe. Warren has a nice post https://blog.hackmakedo.com/2024/04/09/creating-a-custom-condition-for-umbraco-bellissima-aka-v14/
k
thanks, I will certainly be useing that code 👍 , (maybe not for this) but super useful.
w
Yeh probably need a new condition that works with an array of sections. Probably something should be in core IMO
k
yep feels "corey" - for now (because time is out enemy) duplicate the manifest 😞.
l
The workspace condition has an alternative option of
oneOf
(taking a string array) e.g. https://github.com/umbraco/Umbraco.CMS.Backoffice/blob/v14.0.0-rc2/src/packages/core/workspace/conditions/workspace-alias.condition.ts#L21 Sounds like the section condition is lacking that
oneOf
feature.
k
Ahhh. that makes sense ! ta la.
n
And therefor the Section Alias Condition should get one as well, so here you go. https://github.com/umbraco/Umbraco.CMS.Backoffice/pull/1765
k
Woot! #H5YR
n
I may add that since conditions is a new concept to Umbraco I hope to learn more about the needs and use cases and we will use such inputs to improve and extend the system. So please share findings and ideas 🙂
k
sure, while i am thinking about it, I was wondering about a workspace -> view condition, e.g something that only happens on certain views in a workspace. the potential for this was to not show certain actions in the action slot of a workspace when certain views where visible, as i am building out my ui i have a workspace view that doesn't actually change the underling entity, but it has its own buttons, and the save button at the bottom might be confusing. probibly quite edge case, but not having save at the bottom for that perticular view in the workspace would be nice, i thought maybe this could be achived via conditions ?
n
Thats a good case and makes total sense. We should be able to make a condition where you can define the alias(or aliases) of the views you like an action to be displayed for. 🙂
2 Views