Coder Social home page Coder Social logo

Icon selection about our.umbraco.umbnav HOT 7 CLOSED

nzdev avatar nzdev commented on June 3, 2024
Icon selection

from our.umbraco.umbnav.

Comments (7)

tzbarkan avatar tzbarkan commented on June 3, 2024 1

One way you could do that is by adding the relevant custom class to the item. Then when you're rendering your menu, use that class, and build the link manually:

<a href="@item.Url()" target="@item.Target"><i class="fas @item.CustomClasses"></i>@item.Title</a>

Edit: fixed error in my code. Thanks Aaron.

from our.umbraco.umbnav.

AaronSadlerUK avatar AaronSadlerUK commented on June 3, 2024 1

@nzdev I will need to look into this.

I will probably add a setting which will allow you to set this at data type level.

PRs welcome

from our.umbraco.umbnav.

allysonhw avatar allysonhw commented on June 3, 2024 1

How can I get the Url of the Image/Icon?

from our.umbraco.umbnav.

AaronSadlerUK avatar AaronSadlerUK commented on June 3, 2024 1

@allysonhw The image is stored as an IPublishedContent, so you can use the normal process such as .Url() or .GetCropUrl()

from our.umbraco.umbnav.

AaronSadlerUK avatar AaronSadlerUK commented on June 3, 2024

I had a choice when I implemented the image picker.

Originally it was a free text field, however I felt that wasn't user friendly.

I'm not sure how I could implement both an icon (free text) and image picker side-by-side.

Open to suggestions at this point 😕

from our.umbraco.umbnav.

AaronSadlerUK avatar AaronSadlerUK commented on June 3, 2024

One way you could do that is by adding the relevant custom class to the item. Then when you're rendering your menu, use that class, and build the link manually:

<a href="@item.Url()@item.Anchor" target="@item.Target"><i class="fas @item.CustomClasses"></i>@item.Title</a>

@tzbarkan item.Url() should contain the Anchor automatically, and you shouldn't need to specify both properties

from our.umbraco.umbnav.

nzdev avatar nzdev commented on June 3, 2024

An image picker with the option to restrict by folder and type would work well.

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.