Comments (7)
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.
@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.
How can I get the Url of the Image/Icon?
from our.umbraco.umbnav.
@allysonhw The image is stored as an IPublishedContent, so you can use the normal process such as .Url() or .GetCropUrl()
from our.umbraco.umbnav.
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.
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.
An image picker with the option to restrict by folder and type would work well.
from our.umbraco.umbnav.
Related Issues (20)
- Add option for classes to be a dropdown
- Hover should highlight the menu item
- Advanced settings remains when all settings disabled
- When there is any unpublished content, umbNav breaks: Failed to convert Meganav {ex} HOT 5
- Include Child Nodes toggle doesn't stick HOT 1
- Advanced Configuration include child nodes HOT 1
- Url not available on Link UmbNavItem HOT 6
- After the update UmbNav doesn't work HOT 5
- Sub navigation Not Displaying HOT 12
- trying to add multiple sub menu items to top Nav HOT 1
- Retrieve value from IVirtualPageController (?) does not work HOT 12
- Label item type does not render when at the top level HOT 8
- When ItemType == Link, cannot get Url HOT 13
- Non Content Link Url not accessiable in Views HOT 1
- Member Visibility isn't working HOT 4
- Clone/Fork repo - running test projects fails with `Unable to satisfy conflicting requests` dependency issue HOT 3
- Ability to show active class on a child page HOT 1
- Umbraco V13 support HOT 1
- What is the difference between versions? HOT 2
- Unhandled exception on new install of .Web to Umbraco 13.0.1 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from our.umbraco.umbnav.