Using a placeholder for FontAwesome links in descriptions of settings

Continuing the discussion from How do I add links to site settings into the settings description of my component?:

I wonder if something similar is possible for a link to the free FontAwesome icons. That one is used in the settings description of some components, and if those only contained %{FA_free_link}, then updating the links in core would fix them in all components that use that link. Also, translators wouldn’t have to translate the description again.

This would help when the version changes, but also it would help when the link that was chosen no longer works.
I noticed that the link chosen in autumn no longer takes you to the free icons.
https://fontawesome.com/v6/search?o=r&m=free no longer works. I think https://fontawesome.com/v6/search?ic=free would work now.

Plugins/components that use the link:

I think ideally we would link to https://meta.discourse.org/styleguide/atoms/icons, and it would have a nice search interface to access all available icons. I did have a WIP for that a few months ago… will have to dust it off and see if I can get it mergeable :eyes:

Doesn’t that only show icons already added to the forum? I think it’s quite common to choose other free icons in components like “Social share”.

At the moment yes, but we could improve it to show all available icons. (with an indicator on the ones which are already added)

I thought it might make sense to bump this topic because of DEV: upgrade to fontawesome 7 by tyb-talks · Pull Request #36286 · discourse/discourse · GitHub being merged.

Lots of descriptions of settings of theme components and plugins will need an update again now. So, while for most components it’s mainly about updating the description of the svg_icons setting to mention version 7 instead of 6, it might be helpful to think about having a more permanent solution based on parameters so translators don’t have to translate everything again on each version update.

Adding an example here that contains both: The link and the version number

Would it be better to just remove the version number from these strings?

How do admins know which FontAwesome icons they can use? I mean, currently, it’s safe to assume using the most current version. But when V8 is published, there will be a time where you need to know that icons added in FA8 won’t work, and in cases where the name was changed, you also need to use the FA7 name of the icon. Or is that no longer a problem?

About a year ago, it was cvx who suggested that we keep a version number in the links:

FA6 had a lot of renames, which is why it was so painful. I don’t think FA7 had any - just new/improved icons.

I think in an ideal world, theme/site settings would be able to make use of our icon dropdown.

But yeah, we don’t have that available at the moment… so you’re right that the version number may still be useful.

I was hoping adding placeholders for the version number and a link to the FA website that can be used in component setting descriptions might be easier than a site setting & theme setting & object setting icon dropdown

(And then there are still the components that aren’t migrated to use object settings but use something like

Enter comma-delimited configuration for tags, in the format “tag-slug,icon,iconColor”. Icon color is optional.

)

Site settings do that now, but the description of the setting still links to the list of FA6 icons (not 7, and the filter to only return free icons doesn’t work either).

But I am not sure this currently feels like an improvement to me. It’s quite confusing that you cannot enter all the icons you find by following the link. Before, I could enter “clipboard-question” and add it to svg_icons_subset afterwards. Now, if I want to configure a new icon, I need to leave the setting I want to set up, navigate to the other one, add the new icon, and get back to the setting I wanted to configure.

So the dropdown setting did not really change anything about the problem that there needs to be a link where you find all available icons, and this link needs to be updated on all settings whenever something changes.