2

My Question is How we can add parameters to a Sitecore URL. any help is appreciated

example: example.com/insights/blogs/?category=Skaitmeninė%20transformacija

1 Answer 1

6

for example if you want to add query string to current item you can use :

var url=LinkManager.GetItemUrl(Sitecore.Context.Item);
string urlQS = WebUtil.AddQueryString(url, "category", "Skaitmeninė transformacija"); // "http://www.mysite.net?print=1"

Update:

If you want to add from Sitecore you can use General Link field. In your code you will have next lines to render with query string:

enter image description here

 var linkField = (LinkField) Sitecore.Context.Item.Fields["Link"];
 var url=linkField.GetFriendlyUrl(); 
2
  • Thank you @sitecore Climber, is there a way to do it in Sitecore itself rather in coding? Commented Sep 22, 2017 at 8:19
  • I updated my answer Commented Sep 22, 2017 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.