# Icon macro naming

**URL:** <https://forum.xwiki.org/t/icon-macro-naming/12019>\
**Category:** Development\
**Tags:** proposal\
**Created:** [February 27, 2023, 2:30pm UTC](https://forum.xwiki.org/t/icon-macro-naming/12019 "2023-02-27T14:30:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichaelHamann](https://forum.xwiki.org/user_avatar/forum.xwiki.org/michaelhamann/32/3813_2.png) [@MichaelHamann](https://forum.xwiki.org/u/MichaelHamann)\
**Post date:** [February 27, 2023, 2:30pm UTC](https://forum.xwiki.org/t/icon-macro-naming/12019/1 "2023-02-27T14:30:49Z")

</div>

Hi everyone,

for fixing a bug with icon rendering, I want to [introduce an icon macro](https://jira.xwiki.org/browse/XWIKI-20682). The main question that I want to answer with this thread is the naming as the macro name “icon” has been taken by the [Font Awesome Icon Macro](https://extensions.xwiki.org/xwiki/bin/view/Extension/Font%20Awesome%20Icon%20Macro). I can see the following options:

1. Take “icon” and break the [Font Awesome Icon Macro](https://extensions.xwiki.org/xwiki/bin/view/Extension/Font%20Awesome%20Icon%20Macro).
2. `displayIcon` similar to the display macro.
3. `xwikiIcon`
4. `xIcon`
5. `ic`

While some other developers expressed their preference towards just taking `icon`, the more I think about it the less I like this option as it involves additional work to deal with the breakage and I’m not sure it is really justified for having the nicer name.

My personal preference goes currently towards option 2. Any other opinions?

Thank you very much!

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [February 27, 2023, 2:37pm UTC](https://forum.xwiki.org/t/icon-macro-naming/12019/2 "2023-02-27T14:37:28Z")

</div>

I think I prefer `ic` because I have seen it in other frameworks, but +0 for `displayIcon`.

I’m not a fan of `xwikiIcon` or `xIcon`.

---

<div class="post-metadata">

**Author:** ![Wardenburg](https://forum.xwiki.org/user_avatar/forum.xwiki.org/wardenburg/32/4614_2.png) [@Wardenburg](https://forum.xwiki.org/u/Wardenburg)\
**Post date:** [February 27, 2023, 4:20pm UTC](https://forum.xwiki.org/t/icon-macro-naming/12019/3 "2023-02-27T16:20:40Z")

</div>

I wonder if end users will not be confused if the icon macro itself is bugged and a seperate displayIcon macro is added (or would the icon macro be deprecated in newer versions?)

Either way new name for a new macro sounds sensible and displayIcon is my fav from the options- +1

---

<div class="post-metadata">

**Author:** ![MichaelHamann](https://forum.xwiki.org/user_avatar/forum.xwiki.org/michaelhamann/32/3813_2.png) [@MichaelHamann](https://forum.xwiki.org/u/MichaelHamann)\
**Post date:** [February 27, 2023, 4:31pm UTC](https://forum.xwiki.org/t/icon-macro-naming/12019/4 "2023-02-27T16:31:26Z")

</div>

> [@Wardenburg](#):
>
> I wonder if end users will not be confused if the icon macro itself is bugged and a seperate displayIcon macro is added (or would the icon macro be deprecated in newer versions?)

The macro named “icon” is the [Font Awesome Icon Macro](https://extensions.xwiki.org/xwiki/bin/view/Extension/Font%20Awesome%20Icon%20Macro), so this is a contrib extension which is managed by its authors and has its own versioning. This macro is not bundled and there are no plans to bundle it, so in a regular XWiki installation there will be only one icon-related macro which is the new one. I’m not aware that this extension is bugged, it should continue to work. The name of that macro that is displayed in the UI is also “Font Awesome icon” so at least users using the WYSIWYG editor won’t confuse them and will clearly see the difference.

---

<div class="post-metadata">

**Author:** ![Wardenburg](https://forum.xwiki.org/user_avatar/forum.xwiki.org/wardenburg/32/4614_2.png) [@Wardenburg](https://forum.xwiki.org/u/Wardenburg)\
**Post date:** [February 28, 2023, 2:33pm UTC](https://forum.xwiki.org/t/icon-macro-naming/12019/5 "2023-02-28T14:33:05Z")

</div>

apologies, I misread/misunderstood you.

I had some issues with inserting icons from the userprofile page (using the built in extension) - might’ve just been me!

Either way, thank you for clarifying and the displayIcon addition!

---

<div class="post-metadata">

**Author:** ![MichaelHamann](https://forum.xwiki.org/user_avatar/forum.xwiki.org/michaelhamann/32/3813_2.png) [@MichaelHamann](https://forum.xwiki.org/u/MichaelHamann)\
**Post date:** [March 1, 2023, 11:38am UTC](https://forum.xwiki.org/t/icon-macro-naming/12019/6 "2023-03-01T11:38:04Z")

</div>

> [@Wardenburg](#):
>
> I had some issues with inserting icons from the userprofile page (using the built in extension) - might’ve just been me!

I think I understand your confusion now. There is also the `image:icon:...` -way of inserting icons. This is not a macro, so there is no naming conflict. Thinking about this again, I think this could indeed confuse users, though, if we have suddenly two ways of inserting icons where one of them doesn’t use the current icon theme even though [it is promised to support them in the future](https://extensions.xwiki.org/xwiki/bin/view/Extension/Icon%20Theme%20Application#HDisplayingusingWikiSyntax).

Now the problem is that this image syntax expects that the result will be an image but our current icon theme uses an icon font instead of images. This affects all kinds of areas like the WYSIWYG editor but also the core [rendering of images](https://github.com/xwiki/xwiki-rendering/blob/61386a5e79320a1bc20cdadd40f95a01ee7798b8/xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/image/AbstractXHTMLImageTypeRenderer.java#L100). I’m really not sure we can fix that without breaking things so I’m actually wondering if it wouldn’t be best to just deprecate that image-based icon syntax in favor of the new icon macro. Any opinions?

---

<div class="post-metadata">

**Author:** ![surli](https://forum.xwiki.org/user_avatar/forum.xwiki.org/surli/32/2687_2.png) [@surli](https://forum.xwiki.org/u/surli)\
**Post date:** [March 2, 2023, 10:38am UTC](https://forum.xwiki.org/t/icon-macro-naming/12019/7 "2023-03-02T10:38:41Z")

</div>

+1 for `displayIcon`, it’s more explicit than `ic` IMO

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [March 2, 2023, 10:40am UTC](https://forum.xwiki.org/t/icon-macro-naming/12019/8 "2023-03-02T10:40:38Z")

</div>

+1 for `displayIcon` for the same reason.

---

<div class="post-metadata">

**Author:** ![MichaelHamann](https://forum.xwiki.org/user_avatar/forum.xwiki.org/michaelhamann/32/3813_2.png) [@MichaelHamann](https://forum.xwiki.org/u/MichaelHamann)\
**Post date:** [March 7, 2023, 11:03am UTC](https://forum.xwiki.org/t/icon-macro-naming/12019/9 "2023-03-07T11:03:27Z")

</div>

Thank you for your replies, I went with `displayIcon` in the end, see the [documentation of the new icon macro](https://extensions.xwiki.org/xwiki/bin/view/Extension/Icon%20Macro/). I think we should deprecate or somehow redirect the built-in icon syntax to this icon macro to avoid confusion for users but that’s the topic for another proposal.

---

<div class="post-metadata">

**Author:** ![Wardenburg](https://forum.xwiki.org/user_avatar/forum.xwiki.org/wardenburg/32/4614_2.png) [@Wardenburg](https://forum.xwiki.org/u/Wardenburg)\
**Post date:** [March 7, 2023, 11:39am UTC](https://forum.xwiki.org/t/icon-macro-naming/12019/10 "2023-03-07T11:39:21Z")

</div>

Thank you @MichaelHamann !

+1 for the deprecation/redirect suggest

Looking forward to the displayIcon macro!.. I think looking at teams/whatsapp usage of stickers/emoticons there’s a demand for functionality in these areas.
