Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdemooij9 committed Sep 6, 2022
2 parents 22ebb42 + 5119998 commit a37e3ff
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Extensions;
Expand All @@ -12,7 +8,6 @@
using SeoToolkit.Umbraco.Common.Core.Repositories.SeoSettingsRepository;
using SeoToolkit.Umbraco.Common.Core.Sections;
using SeoToolkit.Umbraco.Common.Core.Services.SeoSettingsService;
using Umbraco.Cms.Core.Services;

namespace SeoToolkit.Umbraco.Common.Core.Composers
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Trees;
using Umbraco.Cms.Web.BackOffice.Trees;

namespace SeoToolkit.Umbraco.Common.Core.Controllers
{
//This controller is only here to prevent single node trees if you only download one package
[Tree("SeoToolkit", "info", TreeTitle = "Info", TreeGroup = "SeoToolkit", SortOrder = 99)]
public class InfoTreeController : TreeController
{
public InfoTreeController(ILocalizedTextService localizedTextService, UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, IEventAggregator eventAggregator) : base(localizedTextService, umbracoApiControllerTypeCollection, eventAggregator)
{
}

protected override ActionResult<TreeNode> CreateRootNode(FormCollection queryStrings)
{
var root = base.CreateRootNode(queryStrings);

root.Value.Icon = "icon-info";
root.Value.HasChildren = false;
root.Value.RoutePath = $"SeoToolkit";
root.Value.MenuUrl = null;

return root.Value;
}

protected override ActionResult<TreeNodeCollection> GetTreeNodes(string id, FormCollection queryStrings)
{
return TreeNodeCollection.Empty;
}

protected override ActionResult<MenuItemCollection> GetMenuForNode(string id, FormCollection queryStrings)
{
return null;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Product>SeoToolkit Common Core</Product>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using NUglify.JavaScript.Syntax;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Actions;
using Umbraco.Cms.Core.Events;
Expand Down

0 comments on commit a37e3ff

Please sign in to comment.