Hi guys, I have a question about bucket elements in Sitecore.
I have the following structure:
I want to create a button on the "test" page, which will return to the top bucket "News Overview".Usually I would do something like:
LinkManager.GetItemUrl(Sitecore.Context.Item.Parent)
The problem is that the direct parent is the bucket "44" and not the "News Overview".What would be the best way to link to the survey bucket?
Thanks in advance!
The element has an extension method that gives you the bucket element of your current element.
Its in the namespace Sitecore.Buckets.Extensionsin the assembly Sitecore.Buckets.dll.
Sitecore.Buckets.Extensions
Sitecore.Buckets.dll
:
var bucketItem = Sitecore.Context.Item.GetParentBucketItemOrParent(); var urlToBucket = LinkManager.GetItemUrl(bucketItem);
BucketManager, , :
BucketManager.IsItemContainedWithinBucket(Sitecore.Context.Item)
[Sitecore.Data.Items.Item].Parent , , , , .
[Sitecore.Data.Items.Item].Parent
[Sitecore.Data.Items.Item].Axes.GetAncestors(), Item .
[Sitecore.Data.Items.Item].Axes.GetAncestors()
Item
/ , Sitecore 7. , , Sitecore 6, Sitecore 7.
Source: https://habr.com/ru/post/1533159/More articles:Is associated assignment in C / C ++ undefined behavior? - c ++Find the closest value in the matrix matrix - matrixjBPM 6.0 ksession clustering - jbpmAndroid library project says nullpointerexception - androidНет видимого @interface для 'GPUImageOutput' объявляет селектор 'imageFromCurrentlyProcessedOutputWithOrientation:' - iosHow to integrate TinyMCE editor with php - phpChecking the execution of blocks and queues in NSDictionary - objective-cWhat does a “friend” do in obj c? - iosPassing HTML5 local storage value in PHP - javascriptWhy does the xcode IDE think that “friend” is a reserved word - c ++All Articles