aaronsadleruk / our.umbraco.umbnav Goto Github PK
View Code? Open in Web Editor NEWDrag and drop menu editor for Umbraco V8, V9 and V10+
License: MIT License
Drag and drop menu editor for Umbraco V8, V9 and V10+
License: MIT License
9.0.0
Add an image to a link where umbracoNaviHide is true and the image will continue to be disaplayed in the menu
No response
Add a link to a node item
Update the umbracoNaviHide property to be true
Image should be hidden
8.16.0
Umbraco 8.16.0
UmbNav 1.1.4
Code below fails as .Url is set to internal .Url() also fails - when linking to umbraco content, .Content.Url() works - this is just an issue when the type is Link.
if (subNavItem.ItemType == UmbNav.Core.Enums.UmbNavItemType.Link)
{
<a href="@subNavItem.Url">@subNavItem.Title</a>
}
Seems to be that this line is set to internal?
https://github.com/AaronSadlerUK/Our.Umbraco.UmbNav/blob/umbraco-v8-v9/src/UmbNav.Core/Models/UmbNavItem.cs#L67
see code above
No response
version 10.5.1
When adding a menu item that is not internal content e.g. Link to https://google.com this value is not accessible due to UmbNavItem.Url
being an internal property, thereby giving no way to render these within views.
No response
Example of configured menu item containing an external non-content link.
A property is accessible wit the url for a non content link allowing code similar to the following to render the link to an external url.
<a href="@(child.Content != null ? child.Content.Url() : child.Url)" target="@child.Target">
@child.Title
</a>
v8.15.2
Install-Package Our.Umbraco.UmbNav.Web
No response
can find the file on nuget Our.Umbraco.UmbNav.Web
No response
Currently when adding a child item it gets added to the bottom of the list.
It would be nice to be able to add a child item under the parent saving the need to drag into the correct parent
It would be great to replace angular-ui-tree with either a native js implementation or something which isn't tightly coupled to angularjs
Currently the multilingual support is clunky to say the least.
It would be nice to be able to choose any enabled language in the node picker, handle the fallbacks gracefully and improve the underlying code for the multilingual part
Umbraco version 9.4.3
when in the "content" section I set the "include child nodes" flag to true, the data is not saved and therefore the sub-items of the menu are not displayed.
Thanks
No response
I expect the data to be stored and the submenu to be displayed
Currently there is multiple YAML files.
It would be great to condense these down into a single file which handles the versioning nicely.
v8.15.2
parent image is showing but the image on the child is not working.
No response
@foreach (var item in nav.UmbNav) { <h3>@item.Title</h3> @if (item.Children.Count() != 0) { <ul> @foreach (var child in item.Children) { <li> @if (child.Image != null) { <img alt="@child.Image.Name" src="@child.Image"> } <a href="@child.Url()" target="@child.Target" rel="@child.Noopener @child.Noreferrer">@child.Title</a> </li> } </ul> } }
The result of child item image is null.
8.16
When the global nav contains unpublished items, the navigation disappears
Failed to convert Meganav "System.NullReferenceException: Object reference not set to an instance of an object.
at Umbraco.Web.PublishedContentExtensions.GetCultureFromDomains(IPublishedContent content, Uri current) in D:\a\1\s\src\Umbraco.Web\PublishedContentExtensions.cs:line 202
at AaronSadler.MegaNavV8.Core.ValueConverters.MeganavV8ValueConverter.BuildMenu(IEnumerable1 items, Int32 level) at AaronSadler.MegaNavV8.Core.ValueConverters.MeganavV8ValueConverter.BuildMenu(IEnumerable
1 items, Int32 level)
at AaronSadler.MegaNavV8.Core.ValueConverters.MeganavV8ValueConverter.BuildMenu(IEnumerable`1 items, Int32 level)
at AaronSadler.MegaNavV8.Core.ValueConverters.MeganavV8ValueConverter.ConvertIntermediateToObject(IPublishedElement owner, IPublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, Object inter, Boolean preview)"
Tested in Chrome and Firefox
Create a navigation map where a page is unpublished
Expected: When there is an unpublished page in the navigation, it just musn´t be showed in the menu, not break the navigation menu
Actual: Instead of returning {System.Linq.Enumerable.WhereListIterator<AaronSadler.MegaNavV8.Core.Models.MeganavV8Item>} it returns {AaronSadler.MegaNavV8.Core.Models.MeganavV8Item[0]} despite many others published pages in the navigation
Actual:
10.3.2
I made the latest update of "UmbNav" to version 2.0.3 and in the "Content Section" I no longer see the items I had uploaded. I cannot add or delete entries.
The naming of my menu items has changed to a generic "item".
For example: "legislation" has become "item 1".
In the frontend the entries are displayed correctly
No response
Create a menu and then update Umbnav to the version 2.0.3
be able to edit, add, view items as before the upgrade
V9RC3
The navigation ui is greyed out and has a red box around it
No response
Install UmbNav. Use with existing MegaNavV8 document (new umbnav config).
No red box, not greyed out.
8.17.1
When using external links the UmbNavItem doesn't have the link value. The Content property comes back as null and there is not other property reflecting the link value although the ItemType is set correctly to Link.
No response
Add an external link and try to render it.
No response
8.17.0
UmbNavMenuBuilderService not respecting Member visibility (Hide if member is logged in/out).
I believe this line is missing in the UmbNavMenuBuilderService when checking the Member visibility
https://github.com/AaronSadlerUK/Our.Umbraco.UmbNav/blob/develop/src/UmbNav.Core/Services/UmbNavMenuBuilderService.cs#L62
removeItems.Add(item);
This other check already has this line
Menu items set up with Member visible item settings are not respected.
Set up menu with items that contain Member visibility settings (Hide if member is logged in/out). When retrieving the menu items they still contain these items.
When retrieving the menu items, they shouldn't contain these items if they are not to be rendered.
8.16.0
In the property editor, a link can be changed to a label, but keeps all of its link properties.
In order to null those properties, you have to change it back to a link and manually delete the field values.
The link properties are available in the navItem in cs and cshtml files.
No response
Either Links cannot be changed to labels, or the link properties would be nulled (shared properties like custom classes should remain).
8.16
isActive property is always false
No response
Install the package and add some items to the menu. Go to one of those items. inSpect the isActive property
The isActive property of the current menu item should be true when you visit its URL.
9
When all additional settings have been disabled, the advanced settings block remains visible
No response
n/a
It should be hidden
It would be useful to be able to add multiple nodes in a single action in addition to one at a time
There are situations where we want a label with dynamic children. But the only way to do that is with a link. It would be helpful if there were a way to have a label that could show child nodes of a specific page.
9.0.1
When setting the noreferrer or noopener checkboxes in the backoffice, they are not reflecting the saved status
No response
They should be ticked if true
No response
v8
Huw Reddick on Our Umbraco:
Hi,
I just installed the rc1 for this, however I am getting an error when trying to access the Content property of a UmbNavItem
CS1061: 'UmbNavItem' does not contain a definition for 'Content'
No response
I have a very customised menu rendering in which I needto retreive various values from the navigation nodes in order to process them.
So I need access to the IPublished Content of the menu nodes but don't seem to be able to.
I need to do something like
navitem.Content.HasProperty("disableDropdown")
I realise I could accomplish some of this using the new properties on your nav item, but I didn't want to have to edit every item in the menu as these settings are already set on each of the content nodes.
No response
When publishing an Umbraco V9 site, the app plugins folder does not get copied to the publish / output folder
It would be nice if UmbPack could be added to the YAML file
v8.15.1
Hello !
I'm testing your package for eventual use in one of our future projects.
I've added some nodes to the tree and I'm trying to render them using following code:
@foreach (var item in Model.Content.Website().Menu) { @item.GetLinkHtml(Model.CurrentCulture.Name) }
Unfortunately this is only rendering the rootnodes without the children.
Any info on how to render the whole tree? Thanks!
No response
Use this code to render tree:
@foreach (var item in Model.Content.Website().Menu) { @item.GetLinkHtml(Model.CurrentCulture.Name) }
Rendering the full tree.
8.16.0
Given this structure in the property editor:
And this helper:
@helper makeNav(IEnumerable<UmbNavItem> items){
<ul>
@foreach (var item in items) {
<li>
@if (item.ItemType =-- UmbNavItemType.Label) {
<h3>@item.Title</h3>
}
else {
@item.GetLinkHtml()
<a href="@item.Url()@item.Anchor" class="@item.CustomClasses" target="@item.Target">@item.Title</a>
}
@makeNav(item.Children)
</li>
}
</ul>
}
Executing the helper:
<a>Label B/C</a>
<a>
tag for Link X has an href, but @item.Title is emptyNo response
Execute helper with recursion.
10.2.1
When using a route the GetValue from a UmbNav property returns null
I'm not 100% sure this is related to IVirtualPageController but it's working for "normal" pages
I have a route setup like this
u.EndpointRouteBuilder.MapControllerRoute(
"Category view",
"/category/{shortname}",
new { Controller = "Category", Action = "Category" });
And the controller looks something like this
public class CategoryController : UmbracoPageController, IVirtualPageController
{
public IPublishedContent? FindContent(ActionExecutingContext actionExecutingContext)
{
if (_umbracoContextAccessor.TryGetUmbracoContext(out var umbracoContext))
{
var categoryRoot = umbracoContext.Content.GetById(1083); // todo: hämta listnamn
if (categoryRoot != null)
{
return categoryRoot;
}
}
return null;
}
public IActionResult Category(string shortname)
{
// retrieve data from db etc
var viewmodel = new MyViewModel();
return View(viewmodel);
}
}
The view inherits a layout that calls a TopMenu component
@(await Component.InvokeAsync("TopNavigation", new { selected = Model.Selected }))
And that component looks like this
[ViewComponent(Name = "TopNavigation")]
public class TopNavigationViewComponent : ViewComponent
{
private readonly INavigationService navigationService;
public TopNavigationViewComponent(INavigationService navigationService)
{
this.navigationService = navigationService;
}
public IViewComponentResult Invoke(int selected)
{
var model = new TopNavigationViewModel()
{
Items = this.navigationService.GetTopNavigation(),
};
return View(model);
}
}
The NavigationService
public class NavigationService : INavigationService
{
private readonly UmbracoHelper umbracoHelper;
private readonly ISiteSettings siteSettings;
public NavigationService(UmbracoHelper umbracoHelper, ISiteSettings siteSettings)
{
this.umbracoHelper = umbracoHelper;
this.siteSettings = siteSettings;
}
public List<IPublishedContent> GetSubNavigation(int currentId)
{
var currentPage = this.umbracoHelper.Content(currentId);
var parentOrSelf = currentPage.AncestorOrSelf(2);
return parentOrSelf.Children?.ToList();
}
public IEnumerable<UmbNavItem> GetTopNavigation()
{
var menu = this.siteSettings.Menu;
return menu;
}
}
The siteSettings
public class SiteSettings : ISiteSettings
{
private readonly UmbracoHelper umbracoHelper;
private readonly IUmbracoContextFactory umbracoContextFactory;
private readonly IContentService contentService;
public SiteSettings(UmbracoHelper umbracoHelper, IUmbracoContextFactory umbracoContextFactory, IContentService contentService)
{
this.umbracoHelper = umbracoHelper;
this.umbracoContextFactory = umbracoContextFactory;
this.contentService = contentService;
}
private IPublishedContent home => this.umbracoHelper.ContentAtXPath($"//{ContentTypeAlias.Home}")?.FirstOrDefault();
private IPublishedContent settings => this.umbracoHelper.ContentAtXPath($"//{ContentTypeAlias.SiteSettings}")?.FirstOrDefault();
public string SiteName => this.home.Name;
public IEnumerable<UmbNavItem> Menu => this.settings.GetProperty(PropertyAlias.HeaderMenu).GetValue() as IEnumerable<UmbNavItem>;
}
When NOT using the route the GetValue works fine and I get an IEnumerable
But when using the route i will get this (immediate window)
this.settings.GetProperty(PropertyAlias.HeaderMenu).GetValue() as IEnumerable<UmbNavItem>
Count = 0
Current: null
Results View: Expanding the Results View will enumerate the IEnumerable
If I add a watch to this.settings.GetProperty(PropertyAlias.HeaderMenu) I get that the _sourceValue is set
[{"udi":"umb://document/0dea73210cd349c492846538f436bb33","key":"0dea7321-0cd3-49c4-9284-6538f436bb33","name":"Om oss","description":"/om-oss/","title":"Om oss","url":"/om-oss/","children":[],"icon":"icon-umb-content color-blue","published":true,"naviHide":false,"culture":null,"itemType":"link","id":1075,"collapsed":true},{"udi":"umb://document/bdec7357fd824e36bb112bf0a490614b","key":"bdec7357-fd82-4e36-bb11-2bf0a490614b","name":"Min sida","description":"/min-sida/","url":"/min-sida/","children":[],"icon":"icon-umb-content color-blue","published":true,"naviHide":false,"culture":null,"itemType":"link","id":1080,"collapsed":true}]
but _sourceValues are null.
I created another text propery and I can retrieve that without problem so I figured that there might be something with UmbNav
If I compare the watch data when calling from route compared to without, I can't find anything different of the two.
I add screenshots of the watch data, if that is useful.
Expected to retrieve a value from GetValue, but instead got null result
9.0.0
I downloaded this repo and I'm trying to setup UmbNav by running TestSite.V9. I get the following exception when the home page tries to load
I notice that the UmbNav package doesn't appear to be installed. All the content from uSync appears to be there but not UmbNav
Download repo and run the TestSite.V9, setup with existing Umbraco database
I'd hope to use UmbNav, please advise
Is your feature request related to a problem? Please describe.
I'm trying to use UmbNav in a nested content object and to have a main navigation item with some sub nav items in there, I needed to do it like this because there are other properties I need to attach to the main navigation item e.g icon, colours, etc.
but there is no way to limit the maximum/minimum number of items you can add to the UmbNav editor.
My workaround would be to use 2 pickers, one for the main item with Minimum number of items = 1 and the other one for the sub nav but doing this means I loss all the good things UmbNav has already.
Describe the solution you'd like
I think the solution would be to implement Maximum & Minimum number of items just like the MultiNodeTreePicker
Thanks,
Ale
9.0.0
Collapse or expand all the menu items and then save, it should remember the last set configuration on reload
No response
Click collapse / expand all
Save and publish
It should remember the last configuration on reload
The method to build a tag for any UmbNavItem is to use item.getLinkHtml(), there doesn't appear to be any comparable helper for labels. Calling someLabel.getLinkHtml() is somehwat confusing for rendering an inert label.
It would be handy if there were a helper like item.getItemHtml() which would render the appropriate html based on the umbnav itemtype.
The constants class clashes with the Umbraco Forms default theme files for recaptcha.
8.16.0
If you have a link set to include child nodes, editing it and saving it will unset "include child nodes".
No response
Note that the checkbox remains checked during editing, it is only on save that it is unset.
Only properties that were edited should change
I've completed the installation and have the new property type. I've added it to my homepage doc type and have the menu created.
master page
<!-- Navigation-->
@await Html.PartialAsync("Navigation")
navigation partial
<!-- Navigation-->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" id="mainNav">
<div class="container px-4 px-lg-5">
<a class="navbar-brand" href="@homePage.Url()">Test Site</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
Menu
<i class="fas fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ms-auto py-4 py-lg-0">
@await Html.PartialAsync("Partials/Navigation/TopNavigation")
</ul>
</div>
</div>
</nav>
The Top and Sub Navigation Code is pulled directly from the github.
I have also added the following to the _ViewImports
@using UmbNav.Core
@addTagHelper *, UmbNav.Core
The site loads without error, top nav displays, but the menu will not display the dropdown. I would like it to display at least 2 sub-menus. Under Test, I have added two pages.
Ex:
When I inspect the code, I see the following:
<ul class="navbar-nav ms-auto py-4 py-lg-0">
}
<a class="nav-link" href="/">Home</a>
<a class="nav-link" href="/about/">About</a>
<a class="nav-link nav-link--active" href="/news/">News</a>
<a class="nav-link" href="/test/">Test</a>
</ul>
I am not sure what I am missing, but any advice would be greatly appreciated.
9.0.1
I've got as far as getting an item injected, but can't see how to add a URL for a link
if (item.Title == "Sales")
{
var salepage = new UmbNavItem() {
Id = 0,
Udi = null,
Key = new System.Guid(),
Title = "new item",
Target = null,
Noopener = null,
Noreferrer = null,
Anchor = null,
Children = Enumerable.Empty<UmbNavItem>(),
Culture = null,
ItemType = UmbNav.Core.Enums.UmbNavItemType.Link,
DisplayAsLabel = false,
Image = null,
CustomClasses = null,
Level = item.Level,
IsActive = false,
Content = null
};
cchildren.Insert(i+1, salepage);
//cchildren.Remove(item);
}
I can see this is serialised link vs content
{
"description": "/department-forms/classic-car-valuation",
"title": "testing",
"url": "/department-forms/classic-car-valuation",
"children": [],
"icon": "icon-link",
"itemType": "link"
},
{
"id": 2430,
"udi": "umb://document/fdce71ab98064b028aa59823620e0ae9",
"key": "fdce71ab-9806-4b02-8aa5-9823620e0ae9",
"name": "Sales",
"description": "/4x4s-cars-vans/sales/",
"url": "/4x4s-cars-vans/sales/",
"children": [],
"icon": "icon-auction-hammer color-red",
"published": true,
"naviHide": false,
"culture": "undefined",
"itemType": "link",
"collapsed": true
},
Any ideas?
No response
as above
No response
Umbraco version 11.1.0
If a label item is created as the top level, this does not appear in the model of the view. If a label item is created as a child item of a link, it is contained in the model no problem
No response
Add a label item to the top level
Add a label item as a child item to a link
Both label items should apper in the view model IEnumerable<UmbNavItem>
Only the nested item actually appears.
Going down the list of toggleable features in the data type, it can get a little confusing as to which toggles disable something and which ones enable something. It would be great if all toggles behaved consistently, instead of having some toggles Allow something and others Hide something.
Metadata file 'C:\Users\mike.nuget\packages\lucene.net\3.0.3\analyzers\dotnet\cs\Lucene.Net.CodeAnalysis.CSharp.dll' could not be found UmbNav.Core (net50)
clone repo and try to run either test site.
Sorry if this is a simple fix, but I'm not up to date with multitargetted package creation.
I tried adding.. <PackageReference Include="Lucene.Net" Version="4.8.0-beta00014" PrivateAssets="all" />
as suggested elsewhere but doesn't seem to resolve
8.17.0
In the content section, the Include Child Nodes Toggle doesn't stick after clicking submit to close the overlay, this is regardless of whether or not there are child nodes.
No response
Add UmbNav data type to document type, making sure the Include Children option is enabled < select a node > check the include child nodes box > press submit > press edit > note that the box is unchecked. The same thing happens if you submit > save and publish > edit.
No response
9.4.3
Url not available on Link UmbNavItem. When using the Link navigation item type the url is not available.
No response
Set up a doc with umbnav
Set up a Link item type with a url and no anchor set
Retrieve the UmbNavItem from the Published Property
Url is not available
Url is available.
;-)
And presumably some backoffice credentials?
An editor may not always know which classes are available, so there should be an option to have the css classes text box as a dropdown
Umb 9.0.0 umbNav 1.0.0.2
Adding a lablel in the tree causes System.Linq.EmptyPartition`1[UmbNav.Core.Models.UmbNavItem] to be returned when querying the property for rendering. raw json below if that helps?
[
{
"id": 2408,
"udi": "umb://document/a437048758ac4f77be90d1cc748c0851",
"key": "a4370487-58ac-4f77-be90-d1cc748c0851",
"name": "4x4s, Cars & Vans",
"description": "/4x4s-cars-vans/",
"url": "/4x4s-cars-vans/",
"children": [],
"icon": "icon-store color-blue",
"published": true,
"naviHide": false,
"culture": "undefined",
"itemType": "link"
},
{
"id": null,
"udi": null,
"description": null,
"title": "General Information",
"target": null,
"noopener": false,
"noreferrer": false,
"anchor": null,
"url": null,
"children": [],
"icon": "icon-tag",
"includeChildNodes": false,
"itemType": "nolink"
}
]
No response
Add a label
labels should be possible.
When hovering over a menu item in the backoffice it should darken the background slightly
Is your feature request related to a problem? Please describe.
It would be awesome (potentially font awesome), to be able to pick an icon to go along with the navigation item
Describe the solution you'd like
It would be great to have an option to select an icon from an icon set and or provide an icon name to use.
Describe alternatives you've considered
Some other icon to menu item map.
8.16.0
Umbraco not make me install the umbnav package
No response
I created a new project on umbraco 8.16.0 and tried to install from the umbraco package its showing me the following error
No response
The documentation could do with being massively improved, the addition of more examples would be useful
11.1.0
I am trying to create multiple sub menu items under main navigation and unable to see the items after they are added on the screen.
No response
this can be reproduced by trying to add multi level sub menu items under main nav
No response
8.16.0
RC10 requires Examine 2.0.0-beta2, but Umbraco 8.16.0 requires Examine < 2.0.0.
I'm not sure about future versions of Umbraco 8.*, but it would be a deal breaker for us to upgrade Umbraco to support a pre-release Examine package. Given the amount of work you've put in to support Umbraco 8, it's a shame to have one dependency make your whole package incompatible.
No response
Try to update to RC10 pre-release of UmbNav
No response
8.16.0
After we update the cms to latest stable version 8.16.0. Umbnav is not taking on the front end .its shows blank
No response
install or update the umbraco version
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.