mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Adapting ShowTags view model
The new model change would break some themes
This commit is contained in:
@@ -33,7 +33,7 @@ namespace Orchard.Tags.Drivers {
|
|||||||
|
|
||||||
protected override DriverResult Display(TagsPart part, string displayType, dynamic shapeHelper) {
|
protected override DriverResult Display(TagsPart part, string displayType, dynamic shapeHelper) {
|
||||||
return ContentShape("Parts_Tags_ShowTags",
|
return ContentShape("Parts_Tags_ShowTags",
|
||||||
() => shapeHelper.Parts_Tags_ShowTags(Tags: part.CurrentTags));
|
() => shapeHelper.Parts_Tags_ShowTags(Tags: part.CurrentTags.Select(x => new ShowTagViewModel { TagName = x })));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override DriverResult Editor(TagsPart part, dynamic shapeHelper) {
|
protected override DriverResult Editor(TagsPart part, dynamic shapeHelper) {
|
||||||
|
@@ -91,6 +91,7 @@
|
|||||||
<Compile Include="ViewModels\TagsAdminCreateViewModel.cs" />
|
<Compile Include="ViewModels\TagsAdminCreateViewModel.cs" />
|
||||||
<Compile Include="ViewModels\TagsAdminEditViewModel.cs" />
|
<Compile Include="ViewModels\TagsAdminEditViewModel.cs" />
|
||||||
<Compile Include="ViewModels\TagsAdminIndexViewModel.cs" />
|
<Compile Include="ViewModels\TagsAdminIndexViewModel.cs" />
|
||||||
|
<Compile Include="ViewModels\ShowTagsViewModel.cs" />
|
||||||
<Compile Include="ViewModels\TagsSearchViewModel.cs" />
|
<Compile Include="ViewModels\TagsSearchViewModel.cs" />
|
||||||
<Compile Include="ViewModels\TagsIndexViewModel.cs" />
|
<Compile Include="ViewModels\TagsIndexViewModel.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@@ -0,0 +1,5 @@
|
|||||||
|
namespace Orchard.Tags.ViewModels {
|
||||||
|
public class ShowTagViewModel {
|
||||||
|
public string TagName { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@@ -4,7 +4,7 @@
|
|||||||
if (tagsHtml.Any()) {
|
if (tagsHtml.Any()) {
|
||||||
tagsHtml.Add(new HtmlString(", "));
|
tagsHtml.Add(new HtmlString(", "));
|
||||||
}
|
}
|
||||||
tagsHtml.Add(Html.ActionLink((string)t, "Search", "Home", new { area = "Orchard.Tags", tagName = (string)t }, new { }));
|
tagsHtml.Add(Html.ActionLink((string)t.TagName, "Search", "Home", new { area = "Orchard.Tags", tagName = (string)t.TagName }, new { }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user