Using Path on IsRoutable directly in the driver & handler

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-07-13 22:27:01 -07:00
parent 4150f814b3
commit 12d2a94718
2 changed files with 5 additions and 5 deletions

View File

@@ -55,7 +55,7 @@ namespace Orchard.Core.Routable.Drivers {
};
// TEMP: path format patterns replaces this logic
var path = part.Record.Path;
var path = part.Path;
if (path != null && path.EndsWith(part.Slug)) {
model.DisplayLeadingPath = path.Substring(0, path.Length - part.Slug.Length);
}
@@ -73,10 +73,10 @@ namespace Orchard.Core.Routable.Drivers {
// TEMP: path format patterns replaces this logic
var containerSlug = GetContainerSlug(part);
if (string.IsNullOrEmpty(containerSlug)) {
part.Record.Path = model.Slug;
part.Path = model.Slug;
}
else {
part.Record.Path = containerSlug + "/" + model.Slug;
part.Path = containerSlug + "/" + model.Slug;
}
if (!_routableService.IsSlugValid(part.Slug)) {

View File

@@ -12,7 +12,7 @@ namespace Orchard.Core.Routable.Handlers {
_routablePathConstraint = routablePathConstraint;
Filters.Add(StorageFilter.For(repository));
OnPublished<IsRoutable>((context, routable) => _routablePathConstraint.AddPath(routable.Record.Path));
OnPublished<IsRoutable>((context, routable) => _routablePathConstraint.AddPath(routable.Path));
}
}
public class IsRoutableHandler : ContentHandlerBase {
@@ -23,7 +23,7 @@ namespace Orchard.Core.Routable.Handlers {
{"Area", "Routable"},
{"Controller", "Item"},
{"Action", "Display"},
{"path", routable.Record.Path}
{"path", routable.Path}
};
}
}