GithubHelp home page GithubHelp logo

Comments (13)

AussieInSeattle avatar AussieInSeattle commented on September 22, 2024 1

Example below - cut off the bottom so I didnt have to blur out my content tree
image

from our.umbraco.umbnav.

AussieInSeattle avatar AussieInSeattle commented on September 22, 2024 1

good catch - missing using statement - adding this to view fixed it:
@using UmbNav.Core.Extensions
Will buy you a beer at CG for your troubles :-)

from our.umbraco.umbnav.

AaronSadlerUK avatar AaronSadlerUK commented on September 22, 2024

Yes that's correct, you need to use the extension method

.Url()

from our.umbraco.umbnav.

AussieInSeattle avatar AussieInSeattle commented on September 22, 2024

that fails also (this is for type=link, not type=content) - see screenshot - am I missing a using that would make .Url() work?

image

from our.umbraco.umbnav.

AaronSadlerUK avatar AaronSadlerUK commented on September 22, 2024

Hmmm .Url() is in the UmbNav.Core DLL

It's been a long time since I've touched V1, I think link is for external URLs, I'd need to get a V8 site up and running to debug

from our.umbraco.umbnav.

AussieInSeattle avatar AussieInSeattle commented on September 22, 2024

I think link is for external URLs
Correct - this is only an issue for external url's - am assuming this is only coming up now as it's rare to have external url's in your top navigation where this package is likely mostly used?

from our.umbraco.umbnav.

AaronSadlerUK avatar AaronSadlerUK commented on September 22, 2024

Yeah I think that could be the case, I've done this and got it working in V10+ So I presume it's a bug specific to V8...

I'll do some digging...

Can you give me an example of the backoffice item, so I can be 100% sure I'm debugging it correctly

from our.umbraco.umbnav.

AussieInSeattle avatar AussieInSeattle commented on September 22, 2024

When debugging I can see .Url (string) populated under Non-Public Properties - so I think it's a matter of making .Url public but only when type=link - not sure who you'd do that

from our.umbraco.umbnav.

AaronSadlerUK avatar AaronSadlerUK commented on September 22, 2024

That was made internal for a specific reason, it broke things with the multilingual which is why the extension method was brought in... I will debug this and get back to you

from our.umbraco.umbnav.

AussieInSeattle avatar AussieInSeattle commented on September 22, 2024

That was made internal for a specific reason, it broke things with the multilingual which is why the extension method was brought in... I will debug this and get back to you

thanks - let me know if you need more info

from our.umbraco.umbnav.

AaronSadlerUK avatar AaronSadlerUK commented on September 22, 2024

I've just run V8 and it works for me:
image
image

These are the two usings:

@using UmbNav.Core.Extensions
@using UmbNav.Core.Models

Are you sure the Url() you are using in your code is the UmbNav one?
Your error seems to say PublishedContentExtensions.Url() whereas the UmbNav one is UmbNavItemExtensions.Url()

from our.umbraco.umbnav.

AaronSadlerUK avatar AaronSadlerUK commented on September 22, 2024

Just to add the UmbNav extension does a null check here:

and returns .Url if it is null here:

from our.umbraco.umbnav.

AaronSadlerUK avatar AaronSadlerUK commented on September 22, 2024

Glad you got it working!

from our.umbraco.umbnav.

Related Issues (20)

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.