New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort domains (Culture and Hostnames) #13797
Conversation
…LanguageAndDomains for correctly sorting domains
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a few small nitpicky things 👍 But overall looks good 😁
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Looks good, tests good 🎉 |
I just noticed the release notes/blog post mentions the 'Add current domain' as being a new feature, but that was already included in the previous minors (in PR #13436) and should be credited to @prjseal 😉 This PR does improve the button UI and it was recently added, so I do understand the slight confusion... |
Prerequisites
If there's an existing issue for this PR then this fixes #8299.
This includes most changes done in PR #8316 that targeted v8.
Description
As mentioned in the above linked issue (and v8 PR), ordering of the node domains is important, since the first one will be treated as the primary domain (when generating absolute URLs and none match the current URL) and this order can also be used to automatically generate a language selector on the front-end.
This PR includes the following changes:
SortOrder
property to the service level models (Umbraco.Cms.Core.Models.IDomain
andUmbraco.Cms.Core.Models.UmbracoDomain
), database model (Umbraco.Cms.Infrastructure.Persistence.Dtos.DomainDto
) and routing/NuCache model (Umbraco.Cms.Core.Routing.Domain
);sortOrder
column to theumbracoDomain
table and setting initial values in a migration (compatible with SQLite);Sort
method toUmbraco.Cms.Core.Services.IDomainService
with a default interface implementation (returning a failed operation result) and implemented this in theUmbraco.Cms.Core.Services.DomainService
(using a similar contract/implementation as other services);DomainCache
andDomainUtilities
both honour the sort order when returning the domains and selecting the primary domain (and thereby ensuringDefaultUrlProvider
uses the correct primary domain when generating absolute URLs);These changes can be tested by following these steps:
en-US
);Inherit
and back to a language.