Why isn't the sprite/CSS from custom theme used if the theme is applied for a user?
I work on an integration for cPanel and we use a common dev server and multiple themes to work on different requirements. However, I noticed today that even though I selected a different theme while creating a user account, and the URL in the browser's address bar rightfully reflects as such:
It's not really pulling the sprite/icons/CSS from the corresponding theme's
directory. Is this the intended behavior? I dug through the docs and found that customizations related to icons/CSS is applied via
directory. The default directory here seems to be linked to
theme's directory. Here's the
output:
My question is: am I doing something wrong or is this working as intended? My expectation was that sprites and such are associated with the theme associated with the user account. But the only way I seem to get icons changed is by directly modifying
theme's contents. II'm guessing this is not the case cause otherwise, this wouldn't make sense:
TLDR; I would like the sprites/icons/CSS associated with the custom theme's directory to be reflected when I login with a user account which has this theme selected.
# cPanel URL
https://internal.company.com:2083/cpsessXXXX/frontend/custom_theme/index.html?login=1
# Sprite URL
https://internal.company.com:2083/styled/current_style/sprites/icon_spritemap.png
# Expected sprite URL
https://internal.company.com:2083/frontend/custom_theme/styled/current_style/sprites/icon_spritemap.png
It's not really pulling the sprite/icons/CSS from the corresponding theme's
styleddirectory. Is this the intended behavior? I dug through the docs and found that customizations related to icons/CSS is applied via
/var/cpanel/customizationsdirectory. The default directory here seems to be linked to
paper_lanterntheme's directory. Here's the
ls -loutput:
[root@cpanel102 styled]# pwd
/var/cpanel/customizations/styled
[root@cpanel102 styled]# ls -l
total 0
lrwxrwxrwx 1 root root 58 Dec 6 2018 default_style -> /usr/local/cpanel/base/frontend/paper_lantern/styled/basic
My question is: am I doing something wrong or is this working as intended? My expectation was that sprites and such are associated with the theme associated with the user account. But the only way I seem to get icons changed is by directly modifying
paper_lanterntheme's contents. II'm guessing this is not the case cause otherwise, this wouldn't make sense:
/usr/local/cpanel/bin/sprite_generator --theme custom_theme
TLDR; I would like the sprites/icons/CSS associated with the custom theme's directory to be reflected when I login with a user account which has this theme selected.
-
Hey there! sorry for the delayed reply, but I wanted to reach out to our user experience team before I replied here to make sure I had all the correct information. I confirmed that it is normal and expected for the theme name to not show up in the request URL. We also don't believe the data inside /var/cpanel/customizations to be related to the issue, since that area would be specific to customizing Paper Lantern itself, and not related to one of the custom themes. The targets of the symlinks for current_style and default_style will depend on where the sprites ended up. If you completely copied Paper Lantern to create their custom theme, the images would likely be in base/frontend/custom_theme/styled/basic/icons to get it to work. The spritesheet generator should then create the sprites in base/frontend/custom_theme/styled/basic/sprites If you need more details than that, it would likely be best to open a ticket so we can check the theme implementation directly on the server. 0 -
[QUOTE] The targets of the symlinks for current_style and default_style will depend on where the sprites ended up. If you completely copied Paper Lantern to create their custom theme, the images would likely be in base/frontend/custom_theme/styled/basic/icons to get it to work. The spritesheet generator should then create the sprites in base/frontend/custom_theme/styled/basic/sprites
This is correct. And it works just fine, as in the sprites get generated in the right folder. Except the spite file and the CSS from these theme directories don't end up getting used. Here's what's shown for CSS when I use "View Source" after logging in as a cPanel user for whom the themecustom_theme
was chosen during account creation: The URL for this page is something like:https://internal.company.com:2083/cpsessXXXXX/frontend/custom_theme/index.html?login=1&post_login=XXXXX
And I can verify the theme the CSS belongs to by modifying the sprite CSS and adding a comment on top in both paper_lantern and custom_theme directories. The one that gets loaded is the paper_lantern one. Is there a step I'm missing, beyond selecting a custom theme from the select menu during account creation for the correct sprites to be picked up?0 -
I did a bit of testing and couldn't come up with much on the CSS issue. It would be best to submit a ticket to our team to see if we can replicate with exact steps, and if we need to get the documentation updated. 0
Please sign in to leave a comment.
Comments
3 comments