News Detail page Url

Posted by Community Admin on 04-Aug-2018 09:53

News Detail page Url

All Replies

Posted by Community Admin on 03-Jul-2015 00:00

Dear SF supports,

 

I'm having troubles when trying to get News item url in another language.

 

My website has 2 languages: English and Arabic. In all page, I have 2 links: English and Arabic, which lead user to another language version of current page.

 

For news Detail page, I have the following url:  localhost/.../abc for the News whose title = "abc" and publication date = "2013/03/27"

 

Below is the method I used to get Arabic url:

ObjectFactory.Resolve<UrlLocalizationService>().ResolvePageUrl(pageNode, cultureInfo);

 

with pageNode is the current Page Node.

 

However, it returns localhost/.../التفاصيل

The url is correct, but it should include news' publication date and url name.

 

Could you please support me to fix that.

 

Thanks,

Trung

Posted by Community Admin on 08-Jul-2015 00:00

Hi Trung,

You can use the below code to get the details url:

SystemManager.GetContentLocationService().GetItemDefaultLocation(newsItem).ItemAbsoluteUrl

Please note that you need to include "Telerik.Sitefinity.Services" namespace to use SystemManager.

using Telerik.Sitefinity.Services;


Regards,
Velizar Bishurov
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed