Create link to Sitecore Item

前端 未结 6 1886
Happy的楠姐
Happy的楠姐 2021-02-07 00:42

I know I have done this before but I can\'t seem to remember where or how.

I want to create a link to an Item in Sitecore. This code:

Sitecore.Data.Items         


        
6条回答
  •  南方客
    南方客 (楼主)
    2021-02-07 00:57

    You can render item link as below:

    Sitecore.Data.Items.Item itm = Sitecore.Context.Database.GetItem(someID);
    return Sitecore.Links.LinkManager.GetItemUrl(itm);
    

提交回复
热议问题