c# - Sitecore - Go back to parent bucket -


hi guys i'm having question regarding bucket items in sitecore.

i have following structure:

enter image description here

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

Popular posts from this blog

c# - Sort XmlNodeList with a specific Node value -

Android Java.Lang.RuntimeException : Unable to start activity Component Info -

actionscript 3 - Equivalent to moveReceived in ElectroServer 5 -