Skocz do zawartości

ButterflyPixel

Użytkownik
  • Postów

    13
  • Dołączył

  • Ostatnia wizyta

  • Wygrane w rankingu

    2

Treść opublikowana przez ButterflyPixel

  1. ButterflyPixel

    Popp Theme

    Hi, Following up on the issues I reported previously with the Popp theme, I took some time to dig deeper into the code to understand what was going on, both on the theme side and in IPS 5 core. I was honestly surprised to discover that IPS 5 has completely removed parent-child theme inheritance. The `set_parent_id` column still exists in the database, but it's never referenced anywhere in the PHP codebase. So the idea of using a child theme to preserve customizations across updates, which seemed like the natural solution, simply isn't possible anymore (crazy...). That said, I did manage to identify and fix the issue where the site was loading in light mode instead of the configured dark default for guests and private browsing sessions. The root cause turned out to be in the color scheme switcher script included in the "Scripts" custom template. When no cookie is set (first visit, incognito), the script defaults to `schemes[0]` which is `'light'`, effectively overriding the server-rendered dark scheme. I've detailed both issues below with the exact root causes and suggested fixes, the color scheme bug which can be fixed on the theme side, and the css_variables overwrite on update which appears to be an IPS 5 core limitation but could potentially be mitigated at the theme packaging level. Hope this helps! Bug 1: Color scheme defaults to "light" for guests / private browsing Environment: IPS Community 5.0.16, Popp theme, default scheme set to "dark" Problem: When a visitor accesses the site without any cookies (private/incognito browsing, first visit), the page briefly loads in dark mode (correct, server-rendered `data-ips-scheme='dark'`) but is then immediately overridden to light mode by the Popp color scheme switcher script. Cause: The custom template "Scripts" (hookpoint `core/front/global/globalTemplate:body`) contains the color scheme toggle logic. At the end of the `DOMContentLoaded` handler: javascript const savedScheme = ips.utils.cookie.get('acpthemedefault'); currentIndex = schemes.indexOf(savedScheme); if (currentIndex === -1) currentIndex = 0; applyColorScheme(schemes[currentIndex]); When there is no cookie (new visitor, private browsing), `ips.utils.cookie.get('acpthemedefault')` returns `null`. `schemes.indexOf(null)` returns `-1`, so `currentIndex` falls back to `0`, which maps to `schemes[0]` = `'light'`. The script then calls `applyColorScheme('light')`, overriding the server-rendered dark scheme. This happens regardless of the theme's `set__i-default-scheme` setting. Suggested fix: When no cookie is found, the script should not override the server-rendered scheme. Replace: javascript const savedScheme = ips.utils.cookie.get('acpthemedefault'); currentIndex = schemes.indexOf(savedScheme); if (currentIndex === -1) currentIndex = 0; applyColorScheme(schemes[currentIndex]); With: javascript const savedScheme = ips.utils.cookie.get('acpthemedefault'); currentIndex = schemes.indexOf(savedScheme); if (currentIndex === -1) { /* No cookie found - keep the server-rendered default scheme */ return; } applyColorScheme(schemes[currentIndex]); This way, if the user has never explicitly chosen a scheme, the theme's configured default (set via `set__i-default-scheme` in the theme editor) is respected. --- Bug 2: Theme editor customizations lost on theme update (css_variables overwrite) Environment: IPS Community 5.0.16, Popp theme Problem: When importing a Popp theme update (XML), all theme editor customizations are lost: colors, slider configuration, layout settings, font choices, dark mode variables, etc. Ccause: This appears to be an IPS 5 core issue rather than a Popp-specific bug. The IPS theme import code in `applications/core/modules/admin/customization/themes.php` (around line 514) simply overwrites the `set_css_variables` column with whatever is in the XML: php case 'css_variables': $set->css_variables = $xml->readString(); break; There is no merge logic, no comparison between the existing customizations and the imported defaults. The `saveHistorySnapshot()` call made before import only saves templates and CSS to `core_theme_content_history`, but does NOT include `css_variables`, `view_options`, or `theme_editor_data`. The IPS default theme (set_id 0) stores its configurator values in the master CSS file (`1-2-settings.css`) as CSS custom properties (e.g., `--set__i-default-scheme: system`). These defaults are always present and the user's overrides in `set_css_variables` are merged on top at runtime (in `getCssVariables()`). Themes Popp store ALL their configuration (slider, custom colors, layout, etc.) directly in `set_css_variables`. When the import replaces this column with the XML defaults, ALL customizations are lost, there's no fallback like the master CSS provides for the default theme. Suggested improvements: Consider shipping the theme XML without `<css_variables>` content, or with only the theme's own default variables. This way, user customizations in `set_css_variables` would not be overwritten during updates. My actual solution: We've created a backup/restore script that dumps and restores the `set_css_variables` and `set_theme_editor_data` columns before/after each theme update. This works but is fragile and requires manual intervention. Thanks for reading and have a nice day
  2. ButterflyPixel

    Popp Theme

    Come on ! It's not a problem of IPS. The normal template works perfectly, it's your template who is bugy... I already adverted you twice. Fed up, changing template ASAP.
  3. ButterflyPixel

    Popp Theme

    Another, logo is not showed for the visitor not logged...
  4. ButterflyPixel

    Popp Theme

    Updating this template is really but REALLY a pain. On each update we are afraid to see what will work and what won't... Here is an explanation of what i mean when i say on each update we need to reconfigure all options : https://www.loom.com/share/25d50afec56545b59efec2362a495aca Also, since this v1.0.8 we have now another problem : it doesn't keep the modification made in the theme editor : https://www.loom.com/share/789ded6bc69a47f0a360bc24ede38a81?sid=511ad089-507c-4357-a515-1d80e353d96f Thanks
  5. ButterflyPixel

    Popp Theme

    It happens only with your template not the default theme.
  6. ButterflyPixel

    Popp Theme

    It's absolutly not the CSS, it's simple settings... in your template like color, logo, sliders, ... All are lost after each update.
  7. ButterflyPixel

    Popp Theme

    Hi, Seriously... How can i backup my changes excepted by doing it manually ? This is meaning to take 30 to 40 minutes to note all changes i made and same time to replicate on the updated template because yes each time you update you lose all modifications made... Why don't you offer a child template like all other templates ??? Also, in the slider, the buttons 3 and 4 : links dont work. Thanks
  8. ButterflyPixel

    Popp Theme

    Hi, will we lost all our modifications if we upgrade with this version ? Thanks ! Olivier
  9. ButterflyPixel

    Popp Theme

    Hello, just to know if you saw my request ?
  10. ButterflyPixel

    Popp Theme

    Hello, i saw the upadte, Thanks ! I have two notices : Slider : i think the slider is usefull on Homepage, in the other sections of the website i think it's not usefull because the goal of a slider is to promote some sections of the website and the new user who arrive on the website arrives to the homepage : this is where it is needed. Actually it's only on the forum : do you think it is possible to change this ? More important : could you provide a way to have a child template : we loose all our modifications after each upgrade this is really annoying when you full customize all parts of your website. Thank you, this is the only good template i found for v5 😄 Have a nice day. Olivier
  11. ButterflyPixel

    Popp Theme

    Hello, perfect it works, few questions please : - Slideshow is active on forum, not on other pages, i choose on all pages : normal ? - The active and hover menu text color, where can i customise them if it's possible : https://app.screencast.com/bW09e19mUA7OD - Is there a way to not loosing the customisation after each upgrade ? Thanks for your work !
  12. ButterflyPixel

    Popp Theme

    Don't know what you mean by reply under the correct template : i hope it's here, don't udnerstand also how it is possible you can't see my purchase in invision backend, i was able to access my file here :s Here is my paypal Id payment : 4WF75866155669932 : Hi, sorry if it's not the right area to post my request. We bought your theme and experiment few problems : Slider : We unchecked the option "All pages" : https://app.screencast.com/kMqOAaIboOiQN But even if this option is checked the slider is show on all pages. Am i missing something ? Slider again : On scroll the middle slide has a glitch with the button who goes up in the text of description : https://app.screencast.com/lGlnGsKaU2k7y Problem after this the button is not usable. On Homepage : Witch template must i choose to have the classic view ? Actually i have the image on the left : https://app.screencast.com/unZvpgzHsJIdh You can see the option of the theme editor on the right and i tried to change the option of "Pages" without success. Thanks for your support.
  13. ButterflyPixel

    Codey Theme

    Hi, sorry if it's not the right area to post my request. We bought your theme yesterday and experiment few problems : Slider : We unchecked the option "All pages" : https://app.screencast.com/kMqOAaIboOiQN But even if this option is checked the slider is show on all pages. Am i missing something ? Slider again : On scroll the middle slide has a glitch with the button who goes up in the text of description : https://app.screencast.com/lGlnGsKaU2k7y Problem after this the button is not usable. On Homepage : Witch template must i choose to have the classic view ? Actually i have the image on the left : https://app.screencast.com/unZvpgzHsJIdh You can see the option of the theme editor on the right and i tried to change the option of "Pages" without success. Thanks for your support.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.