35
loading...
This website collects cookies to deliver better user experience
TreeNode
object and set its values based on the values stored for that page in Drupal.NodeAlias
value of the TreeNode
object at this point so that it matched the page's "page alias" (aka slug) in Drupal.NodeAliasPath
but in Xperience 13 the URL of a page is controlled separately and is managed by an editor via the URLs tab in Kentico.Insert()
, the slug was being auto generated based on the DocumentName
of the page, rather than just copying the NodeAlias
.PageUrlPathUrlPath
column (try and say that 10 times in quick succession) within the CMS_PageUrlPath
database table with a foreign key to the NodeID
of the page in question.PageUrlPathInfo
object, update the slug et voilà! But no luck.PageUrlPath
record and that this must be updated in conjunction with updating the slug.CMSModules/Content/CMSDesk/Properties/Urls.aspx
I followed the code through and found the PageUrlPathSlugUpdater
which does exactly the job I needed.PageUrlPathSlugUpdater pageUrlPathSlugUpdater = new PageUrlPathSlugUpdater(page, Culture);
IEnumerable<CollisionData> collidingPaths;
pageUrlPathSlugUpdater.TryUpdate(newSlug, out collidingPaths);
if (collidingPaths.Count() == 0)
{
// Slug was updated
}
else
{
// Slug wasn't updated
}
NodeAlias
property is that there is a 70 character max limit. This was a problem as some of the page aliases for pages in Drupal were longer than this so they were being truncated. PageUrlRetriever.Retrieve(nodeAliasPath)
to get the URL of the page, which generates another (if not more) calls to the database. Previously, you just needed to ensure you were retrieving the NodeAliasPath when getting the page data.