-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrontendConfigurationHandler.cs
More file actions
31 lines (26 loc) · 1.01 KB
/
FrontendConfigurationHandler.cs
File metadata and controls
31 lines (26 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using Associativy.Frontends.Engines.Jit;
using Associativy.Frontends.EventHandlers;
using Associativy.GraphDiscovery;
using Associativy.Models;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Aspects;
namespace Associativy.TagsAdapter
{
// Here other configuration handlers can be implemented too
public class FrontendConfigurationHandler : IJitConfigurationHandler
{
private readonly IGraphManager _graphManager;
public FrontendConfigurationHandler(IGraphManager graphManager)
{
_graphManager = graphManager;
}
public void SetupViewModel(FrontendContext frontendContext, IContent node, Frontends.Engines.Jit.ViewModels.NodeViewModel viewModel)
{
if (node.ContentItem.ContentType == "AssociativyTagNode")
{
viewModel.name = node.As<IAssociativyNodeLabelAspect>().Label;
}
else viewModel.name = node.As<ITitleAspect>().Title;
}
}
}