Created
March 28, 2023 10:58
-
-
Save hishaamn/5ec103d64747b63c12cc1db7134b18ee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SxaDataView : BucketDataView | |
| { | |
| protected override void GetChildItems(ItemCollection items, Item item) | |
| { | |
| if (ItemIDs.MediaLibraryRoot == item.ID) | |
| { | |
| using (new LanguageSwitcher(item.Language)) | |
| { | |
| Item rootItem = ServiceLocator.ServiceProvider.GetService<ISiteMediaRootProvider>().GetRootItem(item.Database); | |
| if (rootItem != null) | |
| item = rootItem; | |
| } | |
| } | |
| using (new LanguageSwitcher(item.Language)) | |
| { | |
| base.GetChildItems(items, item); | |
| items.AddRange(item.GetVirtualChildren()); | |
| } | |
| } | |
| public override bool HasChildren(Item item, string filter) => base.HasChildren(item, filter) || item.HasVirtualChildren(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment