c# - Sitecore - Go back to parent bucket -
hi guys i'm having question regarding bucket items in sitecore.
i have following structure:
i want create button on 'test' detail page goes top bucket 'news overview'.
like:
linkmanager.getitemurl(sitecore.context.item.parent)
the problem here direct parent bucket '44' , not 'news overview'.
best way create link overview bucket?
thanks in advance!
there extension method in item gives bucket item of current item.
its in sitecore.buckets.extensions
namespace in sitecore.buckets.dll
assembly.
you can use this:
var bucketitem = sitecore.context.item.getparentbucketitemorparent(); var urltobucket = linkmanager.getitemurl(bucketitem);
you can use bucketmanager check if item contained within bucket:
bucketmanager.isitemcontainedwithinbucket(sitecore.context.item)
Comments
Post a Comment