Item1284: Using custom FOSWIKI_COLORS_URL in SitePreferences leads to 404 for several images
Priority: Normal
Current State: No Action Required
Released In:
Target Release: patch
When using e.g. (commented the setting just here as otherwise it would break the colors of this topic which looks intersting
):
* Pattern Skin is customized to Local corporative identity.
* #Set FOSWIKI_COLORS_URL = %PUBURLPATH%/Main/LocalSkinCustomization/Local_Colors.css
then the following picture files are not found (404 error) if not present in
LocalSkinCustomization
. Those pictures had to be copied over manually from
foswiki/pub/System/PatternSkin
.
-rw-r--r-- 1 www-data www-data 1106 2009-02-17 16:27 bg_buttoncancel_gradient.gif
-rw-r--r-- 1 www-data www-data 1490 2009-02-17 16:27 bg_button_gradient.gif
-rw-r--r-- 1 www-data www-data 1533 2009-02-17 16:27 bg_submit_gradient.gif
-rw-r--r-- 1 www-data www-data 281 2009-02-17 16:27 bullet-lock.gif
-rw-r--r-- 1 www-data www-data 51 2009-02-17 16:27 bullet-personal_sidebar.gif
-rw-r--r-- 1 www-data www-data 54 2009-02-17 16:27 bullet-toc.gif
-rw-r--r-- 1 www-data www-data 1297 2009-02-17 16:27 button_arrow.gif
-rw-r--r-- 1 www-data www-data 831 2009-02-17 16:27 button_font_selector.gif
I don't think this is what should happen when just defining
FOSWIKI_COLORS_URL
with a customized
.css
file (unless we may have misunderstood something).
--
IngoKappler - 14 Mar 2009
Assigning to
PatternSkin
Agree - not release blocker but OK to fix it naturally.
Please never use
SomethingElse for "AppliesTo". That is a dark hole where people look with a flashlight once per year. In fact I hate that we have that category. All bugs in the Foswiki software are either "Engine" or "Extension". And when it is an Extension the name of the Extension spelled right must be added to the Component field. For engine bugs the Component field can be considered a free text information field.
--
KennethLavrsen - 14 Mar 2009
Ingo, how would you do it?
--
ArthurClemens - 14 Mar 2009
My quick idea would be to look for something like skin and then providing the name for the skin, similar to what we do already for the extensions. I didn't think about the skin to be kind of extension.
--
IngoKappler - 14 Mar 2009
I mean, how would you work with the color settings and images?
--
ArthurClemens - 14 Mar 2009
Well, regarding the colors I'd expect behind a macro (variable) named
FOSWIKI_COLORS_URL
nothing more than color settings or the referred
colors.css
(only colors no images). But I understood this also appears to be your understanding.
I don't know if there is something like e.g. a
FOSWIKI_IMAGE_DIR
that could be customized in the same way like the colors. If that would exist great, then people could set it and throw in the images they customized just using the same names as for the default images in the default directory. I am not sure if that mechanism could be a bit to rough but sounds pretty simple. Maybe some people would like to replace images by using exact new and different names, so possibly a second mechanism could be offered were one can define a setting by specifying what default image name to replace by what custom image name. I'd think of only one macro here that might cover all images by just repeating it for each image (e.g.
%FOSWIKI_CUST_IMAGE{defname="main.gif" custname="/path/to/custom_name.gif"}%
).
Just my 2 cent.
(Slightly off topic: My personal bigger issue is that we have different skins which are not just different skins (colors, images, fonts, etc.) but also different functionality and different technical implementation. In the long run there should be one main skin that will be the official base for everything so everybody can build on top of it and functionality must be independet from that skin).
--
IngoKappler - 14 Mar 2009
With a static CSS file, the directory paths contained within are fixed and cannot be set using a variable. (Now a wiki page with an appropriate skin could be used to dynamically generate a CSS file, but it would slow down the server for every access.) If the CSS file for your customized skin refers to any other files (such as graphic files), it needs to use a path relative to its location or an absolute path. I don't believe this is a bug per se; if you create your own customized skin, it has to use appropriate paths.
As I understand it, there are plans to make
NatSkin the default skin, as it provides more avenues for customizations.
--
IsaacLin - 14 Mar 2009
The following pictures are defined in
Local_Colors.css
and as stated by Isaac we didn't adjust the paths there while the default paths expects all those pictures in the same directory where this
Local_Colors.css
is located.
# grep gif Local_Colors.css
background-image:url(bullet-toc.gif);
background-image:url(bg_submit_gradient.gif);
background-image:url(bg_button_gradient.gif);
background-image:url(bg_button_gradient.gif);
background-image:url(bg_buttoncancel_gradient.gif);
background-image:url(bg_button_gradient.gif);
background-image:url(button_font_selector.gif);
background-image:url(button_arrow.gif);
background-image:url(background_alert.gif);
background-image:url(bullet-personal_sidebar.gif);
background-image:url(bullet-lock.gif);
background-image:url(bullet-lock.gif);
So this is deeper customization than just changing some colors and moving the file to a new location and we just did half of what is required.
I now also retested this
"fix" successfully:
# grep gif Local_Colors.css
background-image:url(../../System/PatternSkin/bullet-toc.gif);
background-image:url(../../System/PatternSkin/bg_submit_gradient.gif);
background-image:url(../../System/PatternSkin/bg_button_gradient.gif);
background-image:url(../../System/PatternSkin/bg_button_gradient.gif);
background-image:url(../../System/PatternSkin/bg_buttoncancel_gradient.gif);
background-image:url(../../System/PatternSkin/bg_button_gradient.gif);
background-image:url(../../System/PatternSkin/button_font_selector.gif);
background-image:url(../../System/PatternSkin/button_arrow.gif);
background-image:url(../../System/PatternSkin/background_alert.gif);
background-image:url(../../System/PatternSkin/bullet-personal_sidebar.gif);
background-image:url(../../System/PatternSkin/bullet-lock.gif);
background-image:url(../../System/PatternSkin/bullet-lock.gif);
Should this change be better documented somewhere or did we miss something?
--
IngoKappler - 16 Mar 2009
Feel free to close if considered ready.
--
IngoKappler - 17 Mar 2009
Closing based on agreement with originator. --
IsaacLin - 17 Mar 2009