How does the system_template.css work?
Versions:
4.50,
FAQ number:
140,
Old FAQ number: 4112
EPiServer 4.50 and later includes some changes in the Util/styles directory:
system.css has been replaced by system_template.css
linkeditor.css has been replaced by linkeditor_template.css
What is the reason for these changes?
EPiServer 4.50 introduced a feature called relocation that allows administrators to relocate virtual directories. For example, the previously hard-coded "edit" directory in EPiServer can now be changed to any location, such as "some/other/unkown/directory/4711". Relocation requires that all URLs are dynamic (the addresses are solved runtime), including URLs in CSS files. However, the CSS standard does not support dynamic content, so EPiServer uses a custom solution that does not break any standards to accomplish this. A part of the solution is to rename CSS files that have dynamic content to "_template.css".
Should I download system.css from somewhere?
No, the system_template.css is actually system.css, so you do not need a separate system.css.
What happens if there is a system.css and a system_template.css?
The system.css file is always loaded first, if it exists. This is to ensure backward compatibility. If no system.css can be found, system_template.css will be loaded.
What happens when the browser requests system.css?
The dynamic CSS technology in EPiServer is totally transparent to IIS and the browser; they are completely unaware of what is going on behind the scenes. When the browser makes a request for system.css, it is system.css that is returned, from the browser's point of view, even if it really was system_template.css that was loaded on the server.
Which one should I refer to in code, system.css or system_template.css?
Always refer to system.css.