Theme designer loads cached theme.designer.json even after Theme change #1700
Replies: 5 comments 2 replies
-
You cannot simply copy a theme folder and create a copy. Themes have a server side component. We will provide official documentation on how to create new theme starting next month dev series webinars. |
Beta Was this translation helpful? Give feedback.
-
Maybe you are referring to the theme.css file as the server component? I can confirm that making a copy of the Basic folder does in fact allow you to have a custom theme, with its own set of customable Theme Editor controls. Maybe its not supposed to work, but it does. |
Beta Was this translation helpful? Give feedback.
-
You cannot simply copy a theme folder and create a copy. Its showing you in the themes list as theme works as a combination of folder and server side components. The issue we are able to duplicate is editing any theme is editing first theme. We will fix this in next update. |
Beta Was this translation helpful? Give feedback.
-
Can you please explain what you mean by 'server side components'? Because following the steps I did sure does seem to have the exact same effect of setting up a new theme. I am able to switch between the two themes. I am able to add my own custom editor controls to my custom theme, edit the default Sass, and remove some controls that I didn't want. I can switch back and forth between the two themes and see different sets of editor controls being loaded and different style choices being applied to the page. So, even if I have set up a new theme "incorrectly", the end effect is that everything works as expected. So, what am I missing? The only additional step that is required is that you have to recycle the app pool to clear the cache when switching themes as it appears the theme.editor.json file is cached. Restarting the application after applying a new theme fixes it. Perhaps the 'server side component' you are referring to prevents this caching problem? |
Beta Was this translation helpful? Give feedback.
-
Ah! OK! I think I actually did that. In the theme folder, I noticed the theme.cs file. I edited this file and changed the name property to my theme name and also put in a unique GUID. Is that all that is necessary? |
Beta Was this translation helpful? Give feedback.
-
I made a copy of the Basic theme. I then edited the new theme.designer.json and stripped out everything except the Site->Colors controls.
This works as expected and only shows the controls left in my new Theme. (yes, I know this breaks a whole bunch of Vanjaro blocks like Login and such, but I'm just messing around).
I then switched the Site theme back to the Basic theme, but the designer did not switch back to the collection on controls for Basic, it still loaded the same collection for my new theme. I suspect the theme.designer.json file is cached after switching themes. The Basic themes controls would not load until after I clicked the Save Theme button on the UX.
This is what I expected to see after Applying the Basic theme:
The UX controls should switch automatically whenever switching themes.
Beta Was this translation helpful? Give feedback.
All reactions