Hi,
I think the internal representation of the link will be in the format:
/link/[content GUID].aspx?epslanguage=[content language]
If you want to change the language to automatic, you should be able to remove the querystring from the URL so you've got a URL in the format:
/link/[content GUID].aspx
Paul is correct. To get a list of all URL properties with specific language set:
SELECT pkId, String from tblContentProperty
WHERE fkPropertyDefinitionID IN
(
SELECT pkId from tblPropertyDefinition where fkPropertyDefinitionTypeID IN
(
SELECT pkId from tblPropertyDefinitionType WHERE Name = 'Url'
)
) AND String LIKE '%?epslanguage=%'
Hi, thanks for quick response!
So if i understand correctly i should try and remove "?epslanguage="{culture}" on all links directly in the database?
/P
Database queries are handy for extracting information but I wouldn't recommend changing the data directly in the database. I would suggest using the IContentRepository to update the links to remove the querystring.
I couldnt change the actual query directly so I had create a new Url object and store that instead.
So far it seems to work.
var clone = currentPage.CreateWritableClone() as GeneralPageModel;
if (clone != null)
{
clone.Video.VideoUrl = new Url(clone.Video.VideoUrl.Path);
_contentRepository.Save(clone, EPiServer.DataAccess.SaveAction.Publish, AccessLevel.NoAccess);
}
Hi
I have a customer where they have used specific language on their Url properties. They want to change this to "automatic".
Is it possible to do this through code? Im hoping to create a scheduled job to crawl all these properties and change the value.
[Display(Order = 10)]
public virtual Url SomeContent{ get; set; }