Developer forum

Forum » Development » Known icons used in front-end

Known icons used in front-end

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I want to make good use of the list of Known icons (available in Settings/Developer) but in Front-end.

Mainly, I want to set up a property on a paragraph that would allow the user to select an icon.

I believe there is no such thing as an IconList field Type, therefore I should settle for either a regular input field or a SQL based select.

My questions:

1. Are the icons definitions stored in table somewhere?

2. Can I access them with the API in the front-end?

Thank you,

Adrian


Replies

 
Nicolai Pedersen
Reply

Hi Adrian

@1: No, it is API only

@2: Yes. You can call i.e. this method and that will give you the right icon html, https://doc.dynamicweb.com/api/html/d6b3aa84-5d8e-f116-cc06-2adc5bbb8169.htm

I would be very careful doing this - I guarentee that we at some point will change this - update icons, upgrade to FA5 or something else. And that will have an impact on your frontend you might not want...

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Understood.

In this case, I believe a Custom Field for Icons might make more sense for me, especially becuase it might be reusable.

Any chance you might consider including in future releases, a standard field of this type?

Or maybe a type of field that would also have a Preview next to the value? Something like the SQL based select only with a preview of the image instead of/next to the label?

Thanks,

Adrian

 
Nicolai Pedersen
Reply

Hi Adrian

I think not - it is the same problem. If I create an icon field type that returns FA4 I am stuck with it for 10+ years. I cannot remove it because we would alter or break design on existing solutions, and durin those year, requests for FA5-10 and other frameworks would be requested and we would have a big and ugly maintenance task...

You can make lists using "icons" if they are images. So you request a version that can insert a piece of markup instead so you can make your own list of icons?

NP

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Understood.

It might makes sense to have a more generic Field Type that can help us build whatever we need. I agree that now it might be an Icon list but in 2 years time might be something else.

The problem is not adding the markup but rather rendering it. I suppose I can add some makup as "Label" but I am sure it won't be rendered. I will try and use the "Icon" property of the Dropdown list for now. I don't think that it makes sense to complicate things further. i should have thought of this before posting the request.

It might make more sense to invest time into a filtrable type of field for longer lists.
We have build something like that if you want to see it and use it.

Thank you,

Adrian

 

 
Nicolai Pedersen
Reply

Thanks, would love to see it!

 

You must be logged in to post in the forum