Coder Social home page Coder Social logo

aaronsadleruk / our.umbraco.umbnav Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 15.0 20.19 MB

Drag and drop menu editor for Umbraco V8, V9 and V10+

License: MIT License

C# 3.61% JavaScript 69.37% HTML 10.33% CSS 16.70%
hacktoberfest hacktoberfest2021 umbraco umbraco-v8 umbraco-v9 umbraco-packages umbraco-v10 hacktoberfest2022 hacktoberfest2023

our.umbraco.umbnav's Introduction

Umbraco UmbNav

NuGet Badge

Umbraco Cloud Badge

UmbNav adds a drag and drop menu builder to the Umbraco V10 backoffice.

Getting started

UmbNav V2.X only supports Umbraco 10+

Use UmbNav V1.X for Umbraco V8 and V9

Features

  • Set maximum child levels
  • Hide menu items where umbracoNaviHide is true
  • Auto expand the backoffice menu tree on hover
  • Set the delay of the auto expand on hover (in ms)
  • Add noopener to external links by clicking a checkbox
  • Add noreferrer to external links by clicking a checkbox
  • Auto add child nodes when rendering on the front end
  • Allow menu items to be shown / hidden depending on member authentication status
  • Add custom CSS classes to each menu item in the backoffice
  • Display the property editor as full width in the back office (Hide the label)
  • Add an image to a menu item
  • TagHelper
  • GetLinkHtml extension for Umbraco V8 and V9
  • Add label items

Installation

UmbNav is available from NuGet, or as a manual download directly from GitHub.

The deprecation of using Ids between V1 and V2 is a breaking change, so if you are using Ids then you will required to rebuild your menu after upgrading

NuGet package repository

To install UI from NuGet, run the following command in your instance of Visual Studio.

PM> Install-Package Our.Umbraco.UmbNav.Web

To install Core from NuGet, run the following command in your instance of Visual Studio.

PM> Install-Package Our.Umbraco.UmbNav.Core

To install API from NuGet, run the following command in your instance of Visual Studio.

PM> Install-Package Our.Umbraco.UmbNav.Api

Umbraco Cloud Supported

UmbNav fully supports Umbraco Cloud including the content synchroniser, it has been fully tested transferring and restoring between environments.

Documentation

After installing the package, you will have a new property editor called UmbNav in the Umbraco backoffice, typically this would get added to your sites "Site Settings" or "Home" node.

Check out the integration guide integration guide to learn how to embed the package in your site.

Screenshots

Contribution guidelines

To raise a new bug, create an issue on the GitHub repository. To fix a bug or add new features, fork the repository and send a pull request with your changes. Feel free to add ideas to the repository's issues list if you would to discuss anything related to the package.

Who do I talk to?

This project is maintained by Aaron Sadler and contributors. If you have any questions about the project please contact me through Twitter, or by raising an issue on GitHub.

License

Copyright © 2022 UmbHost Limited, and other contributors

Licensed under the MIT License.

As per the spirit of the MIT Licence, feel free to fork and do what you wish with the source code, all I ask is that if you find a bug or add a feature please create a to PR this repository.

our.umbraco.umbnav's People

Contributors

aaronsadleruk avatar anthonywhitelaw avatar kevinjump avatar mistyn8 avatar stefanoberetta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

our.umbraco.umbnav's Issues

Advanced settings remains when all settings disabled

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

9

Bug summary

When all additional settings have been disabled, the advanced settings block remains visible

Specifics

No response

Steps to reproduce

n/a

Expected result / actual result

It should be hidden

Image on Child is not working

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

v8.15.2

Bug summary

parent image is showing but the image on the child is not working.

Specifics

No response

Steps to reproduce

@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> } }

Expected result / actual result

The result of child item image is null.

V9 RC11 red outline and greyed out

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

V9RC3

Bug summary

The navigation ui is greyed out and has a red box around it

image

Specifics

No response

Steps to reproduce

Install UmbNav. Use with existing MegaNavV8 document (new umbnav config).

Expected result / actual result

No red box, not greyed out.

RC10 dependency on re-release Examine 2.0.0-beta2 is incompatible with Umbraco 8.16.0

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

8.16.0

Bug summary

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.

Specifics

No response

Steps to reproduce

Try to update to RC10 pre-release of UmbNav

Expected result / actual result

No response

Maximum & Minimum number of items (same as MultiNodeTreePicker)

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

Add child item at parent level

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

Changing link to label retains link properties

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

8.16.0

Bug summary

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.

Specifics

No response

Steps to reproduce

  1. Create Link
  2. Edit it and change it to a Label
  3. View the tree: the label still retains a URL and other properties

Expected result / actual result

Either Links cannot be changed to labels, or the link properties would be nulled (shared properties like custom classes should remain).

UmbNav is not showing on the front end

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

8.16.0

Bug summary

After we update the cms to latest stable version 8.16.0. Umbnav is not taking on the front end .its shows blank

Specifics

No response

Steps to reproduce

install or update the umbraco version

Expected result / actual result

No response

Programmtically injecting umbNavItem

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

9.0.1

Bug summary

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?

Specifics

No response

Steps to reproduce

as above

Expected result / actual result

No response

Improve the documentation

The documentation could do with being massively improved, the addition of more examples would be useful

Render Tree structure

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

v8.15.1

Bug summary

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!

Specifics

No response

Steps to reproduce

Use this code to render tree:

@foreach (var item in Model.Content.Website().Menu) { @item.GetLinkHtml(Model.CurrentCulture.Name) }

Expected result / actual result

Rendering the full tree.

Collapse / Expand All does not remember on reload

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

9.0.0

Bug summary

Collapse or expand all the menu items and then save, it should remember the last set configuration on reload

Specifics

No response

Steps to reproduce

Click collapse / expand all
Save and publish

Expected result / actual result

It should remember the last configuration on reload

Include Child Nodes toggle doesn't stick

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

8.17.0

Bug summary

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.

Specifics

No response

Steps to reproduce

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.

Expected result / actual result

No response

When there is any unpublished content, umbNav breaks: Failed to convert Meganav {ex}

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

8.16

Bug summary

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(IEnumerable1 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)"

Specifics

Tested in Chrome and Firefox

Steps to reproduce

Create a navigation map where a page is unpublished

Expected result / actual result

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:

UmbNavMenuBuilderService not respecting Member visibility

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

8.17.0

Bug summary

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

Specifics

Menu items set up with Member visible item settings are not respected.

Steps to reproduce

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.

Expected result / actual result

When retrieving the menu items, they shouldn't contain these items if they are not to be rendered.

Improve build YAML file

Currently there is multiple YAML files.
It would be great to condense these down into a single file which handles the versioning nicely.

Retrieve value from IVirtualPageController (?) does not work

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

10.2.1

Bug summary

When using a route the GetValue from a UmbNav property returns null

Specifics

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.

Steps to reproduce

I add screenshots of the watch data, if that is useful.

Watch for call WITHOUT route
image

Watch for call WITH route
image

Expected result / actual result

Expected to retrieve a value from GetValue, but instead got null result

After the update UmbNav doesn't work

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

10.3.2

Bug summary

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
umbnav

Specifics

No response

Steps to reproduce

Create a menu and then update Umbnav to the version 2.0.3

Expected result / actual result

be able to edit, add, view items as before the upgrade

Icon selection

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.

Noopener and Noreferrer checkboxes are not showing the true status

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

9.0.1

Bug summary

When setting the noreferrer or noopener checkboxes in the backoffice, they are not reflecting the saved status

Specifics

No response

Steps to reproduce

They should be ticked if true

Expected result / actual result

No response

isActive not working on v8.latest

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

8.16

Bug summary

isActive property is always false

Specifics

No response

Steps to reproduce

Install the package and add some items to the menu. Go to one of those items. inSpect the isActive property

Expected result / actual result

The isActive property of the current menu item should be true when you visit its URL.

Improve multilingual support

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

When ItemType == Link, cannot get Url

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

8.16.0

Bug summary

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>
}

Specifics

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

Steps to reproduce

see code above

Expected result / actual result

No response

Non Content Link Url not accessiable in Views

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

version 10.5.1

Bug summary

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.

Specifics

No response

Steps to reproduce

Example of configured menu item containing an external non-content link.

image

Expected result / actual result

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>

Sub navigation Not Displaying

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:

  • Test
    • Test Dropdown 1
      • Test Dropdown 2

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.

Url not available on Link UmbNavItem

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

9.4.3

Bug summary

Url not available on Link UmbNavItem. When using the Link navigation item type the url is not available.

Specifics

No response

Steps to reproduce

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

Expected result / actual result

Url is available.

Advanced Configuration include child nodes

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

Umbraco version 9.4.3

Bug summary

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
Immagine 2022-05-11 174637

Specifics

No response

Steps to reproduce

Immagine 2022-05-11 174637

Expected result / actual result

I expect the data to be stored and the submenu to be displayed
Immagine 2022-05-11 174955

Editing link properties unsets "Include child nodes"

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

8.16.0

Bug summary

If you have a link set to include child nodes, editing it and saving it will unset "include child nodes".

Specifics

No response

Steps to reproduce

  1. Create a link with title "Why are you like this?" and check "include child nodes"
  2. Save it
  3. Edit it and change the title and save it
  4. Include child nodes will be unset

Note that the checkbox remains checked during editing, it is only on save that it is unset.

Expected result / actual result

Only properties that were edited should change

Recursing into a navigation item causes links and labels to mutate

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

8.16.0

Bug summary

Given this structure in the property editor:

  • Label A
    • Label B
      • Link X
      • Link Y (with target = _blank)
      • Link Z (with custom class .whut)
      • Label C

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:

  1. Label A remains a label and renders as expected
  2. Labels B & C become Links, with no link properties, rendering as <a>Label B/C</a>
  3. Link X remains a link, but getLinkHtml() outputs nothing
  4. The manually constructed <a> tag for Link X has an href, but @item.Title is empty
  5. Links Y & Z remain links and keep value for @title and getLinkHtml() still works as expected

Specifics

No response

Steps to reproduce

  1. Create Label A
  2. Create Label B
  3. Create Link X and drag it as child of Label B
  4. Create Link Y with target _blank and drag as child of Label B
  5. Create Link Z with custom class and drag as child of Label B
  6. Create Label C and drag as child of Label B
  7. Then drag label B as child of Label A

Execute helper with recursion.

Expected result / actual result

  1. Links should remain link elements with all properties the same as at higher levels.
  2. Labels should remain label elements as at first level

'UmbNavItem' does not contain a definition for 'Content'

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

v8

Bug summary

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'

Specifics

No response

Steps to reproduce

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.

Expected result / actual result

No response

Label item type does not render when at the top level

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

Umbraco version 11.1.0

Bug summary

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

Specifics

No response

Steps to reproduce

Add a label item to the top level
Add a label item as a child item to a link

Expected result / actual result

Both label items should apper in the view model IEnumerable<UmbNavItem>
Only the nested item actually appears.

Allow labels to show child nodes of a page

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.

Adding a lablel in the tree causes System.Linq.EmptyPartition`1[UmbNav.Core.Models.UmbNavItem] to be returned

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

Umb 9.0.0 umbNav 1.0.0.2

Bug summary

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"
  }
]

Specifics

No response

Steps to reproduce

Add a label

Expected result / actual result

labels should be possible.

Install-Package Our.Umbraco.UmbNav.Web not working

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

v8.15.2

Bug summary

Install-Package Our.Umbraco.UmbNav.Web

Specifics

No response

Steps to reproduce

can find the file on nuget Our.Umbraco.UmbNav.Web

Expected result / actual result

No response

Add a generic tag helper for umbnav items

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.

External Links not working

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

8.17.1

Bug summary

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.

Specifics

No response

Steps to reproduce

Add an external link and try to render it.

Expected result / actual result

No response

Make toggles consistent on Navigation - UmbNav data type

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.

Images to do not respect umbracoNaviHide

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

9.0.0

Bug summary

Add an image to a link where umbracoNaviHide is true and the image will continue to be disaplayed in the menu

Specifics

No response

Steps to reproduce

Add a link to a node item
Update the umbracoNaviHide property to be true

Expected result / actual result

Image should be hidden

Issue running TestSite.V9

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

9.0.0

Bug summary

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
image

Specifics

I notice that the UmbNav package doesn't appear to be installed. All the content from uSync appears to be there but not UmbNav
image

Steps to reproduce

Download repo and run the TestSite.V9, setup with existing Umbraco database

Expected result / actual result

I'd hope to use UmbNav, please advise

Test Site fails to build - 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)

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

Not able to install package from umbraco package

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

8.16.0

Bug summary

Umbraco not make me install the umbnav package

Specifics

No response

Steps to reproduce

I created a new project on umbraco 8.16.0 and tried to install from the umbraco package its showing me the following error

image

Expected result / actual result

No response

trying to add multiple sub menu items to top Nav

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

11.1.0

Bug summary

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.

Specifics

No response

Steps to reproduce

this can be reproduced by trying to add multi level sub menu items under main nav

Expected result / actual result

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.