We expect the extensions to be well integrated into XWiki. This is achieved by using the *current* color theme, the *current* icon set and by limiting the amount of custom styles (use the styles from the *current* skin as much as possible). In order to make the extension consistent with the L&F of XWiki an extension developer will try to use the same icons and images she sees in the XWiki UI (default skin). This is the case with the noavatar image. Best is if the skins use only icons/images defined in the icon set so that extensions use the same images/icons. Thanks, Marius On Tue, Sep 8, 2015 at 12:12 PM, [email protected] <[email protected]> wrote:
Hi devs,
Following a discussion at http://jira.xwiki.org/browse/XWIKI-12327# I’d like to propose to add this new best practice in the App Guide, i.e. at http://platform.xwiki.org/xwiki/bin/view/DevGuide/BestPractices
Rule: Do not use Skin-specific resources in Extensions/Applications
Rationale: If you do, then your Extension/Application will only work for that Skin. When the default skin in XWiki is modified, your Extension/Application will stop to work fine.
Example: This is what happened in apps like in the Forum app which was using: getSkinFile(“noavatar.png”) where “noavatar.png” was a Colibri-skin resource only. The Forum app was broken when we moved to Flamingo and the Forum app had to be modified to use getSkinFile("icons/xwiki/noavatar.png”) which is better since it’s a global resource, thus available to all Skins (see https://github.com/xwiki-contrib/application-forum/commit/3d3a99e5665265607a...).
WDYT? Anyone disagree? I’d like to clos this topic quickly so that we can close XWIKI-12327.
Thanks -Vincent
PS: Additional idea (I don’t know if it’s feasible): I wonder if we could even prevent getSkinFile() to return a skin-specific resource if the originating code is not from a resource from this Skin or if the originating code is not located in a Children Skin (i.e. a skin css, skin jss or skin vm). i.e. consider that skin-specific resources have a private access level.
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs