Made some changes to get truncatedFolderUrl working in 4.11.1
Probably could use a lot of improvement:) But started working with Autofolders for a blog-type kind of functionality and found out that the current version of Autofolders isn't working as expected any more:( Besides that i really like the idea and approach.
The Niceurl() of autofolders function looks if truncatedFolderUrl is provided on FolderProvider Level, but the Autofoldersettings looks for it at AutoFolder Level. Nice would be if FolderProvider knew what AutoFolders invoked the call. But for now quick fix, pass along a boolean doTruncateFolders to the NiceUrl function in XsltExtensionLibrary
if (autoFolderSetting != null)
{
//property TruncatedFolderUrl of FolderProvider isn't set anywhere, but isn't used either so call to function with a boolean to truncate urlif(!String.IsNullOrEmpty(autoFolderSetting.TruncatedFolderUrl))
return autoFolderSetting.FolderProvider.NiceUrl(umbraco.library.NiceUrl(pageId), true);
elsereturn autoFolderSetting.FolderProvider.NiceUrl(umbraco.library.NiceUrl(pageId), false);
}
Challenge 2 : NotFoundHandler for the internal redirect
This is in no way backwards compatible and can only be used for 4.11.1.
Changes in NotFoundHandler.cs
1. Get the type of the node 2. Add functionality to tell NiceUrl() to truncate the url
publicstaticstring NiceUrl(int pageId)
{
AutoFolderSetting autoFolderSetting = null;
XPathNodeIterator pageNode = umbraco.library.GetXmlNodeById(pageId.ToString());
if (pageNode != null)
{
//string docType = pageNode.Current.GetAttribute("nodeTypeAlias", "");//changed becasue .GetAttribute("nodeTypeAlias", ""); returns nullstring docType = pageNode.Current.LocalName;
autoFolderSetting = AutoFolderSettings.Instance.GetSettings(docType);
}
if (autoFolderSetting != null)
{
//property TruncatedFolderUrl of FolderProvider isn't set anywhere, but isn't used either so call to function with a boolean to truncate urlif(!String.IsNullOrEmpty(autoFolderSetting.TruncatedFolderUrl))
return autoFolderSetting.FolderProvider.NiceUrl(umbraco.library.NiceUrl(pageId), true);
elsereturn autoFolderSetting.FolderProvider.NiceUrl(umbraco.library.NiceUrl(pageId), false);
}
else
{
return umbraco.library.NiceUrl(pageId);
}
}
The Niceurl() of autofolders function looks if truncatedFolderUrl is provided on FolderProvider Level, but the Autofoldersettings looks for it at AutoFolder Level. Nice would be if FolderProvider knew what AutoFolders invoked the call. But for now quick fix, pass along a boolean doTruncateFolders to the NiceUrl function in XsltExtensionLibrary
Made some changes to get truncatedFolderUrl working in 4.11.1
Probably could use a lot of improvement:) But started working with Autofolders for a blog-type kind of functionality and found out that the current version of Autofolders isn't working as expected any more:( Besides that i really like the idea and approach.
But I started working on the 2.0.3 source code from http://autofolders.codeplex.com/
Challenge 1: NiceUrl()
The Niceurl() of autofolders function looks if truncatedFolderUrl is provided on FolderProvider Level, but the Autofoldersettings looks for it at AutoFolder Level. Nice would be if FolderProvider knew what AutoFolders invoked the call. But for now quick fix, pass along a boolean doTruncateFolders to the NiceUrl function in XsltExtensionLibrary
Changes in BaseFolderProvider.cs:
change to IFolderProvider
change to XsltExtensionLibrary.cs
Challenge 2 : NotFoundHandler for the internal redirect
This is in no way backwards compatible and can only be used for 4.11.1.
Changes in NotFoundHandler.cs
1. Get the type of the node
2. Add functionality to tell NiceUrl() to truncate the url
Challenge 1: NiceUrl()
The Niceurl() of autofolders function looks if truncatedFolderUrl is provided on FolderProvider Level, but the Autofoldersettings looks for it at AutoFolder Level. Nice would be if FolderProvider knew what AutoFolders invoked the call. But for now quick fix, pass along a boolean doTruncateFolders to the NiceUrl function in XsltExtensionLibrary
Changes in BaseFolderProvider.cs:
change to IFolderProvider.cs
change to XsltExtensionLibrary.cs
1. Get the type of the node
2. Add functionality to tell NiceUrl() to truncate the url
Challenge 2 : NotFoundHandler for the internal redirect
This is in no way backwards compatible and can only be used for 4.11.1.
Changes in NotFoundHandler.cs. Mainly the way of getting getting the correct node
Maybe this can be of help!
is working on a reply...