0

I tried to edit one of the files in the css folder of my template, but the edits are ignored. I noticed that Joomla doesn't read the real css files, but a "version" of these... and probably this version is not being updated with my changes. Probably, the thing is just I don't know how Joomla works. Could you explain me how can I edit and make effective my css changes, please?

For example:

This is the real file: /templates/ipamise/css/template.min.css

This is what Joomla read: /templates/ipamise/css/template.min.css?1eb857b83038ec0ff5f316953d1b563b

4
  • How are you loading the CSS in your template?
    – Sharky
    Oct 26, 2022 at 11:32
  • I edit the CSS files in the template folder with an editor by accessing them via FTP.
    – Nintendomi
    Oct 26, 2022 at 11:48
  • I mean what code are you using to load the stylesheets within your template's index.php file?
    – Sharky
    Oct 27, 2022 at 7:39
  • I don't know really... because the stylesheet /templates/t_name/css/template.min.css is load automatically... probably when $this->getWebAssetManager() is called in index.php. I'm making my personal template, using Cassiopea as a base to start with, so I want to remove many unnecessary pre-existing CSS.
    – Nintendomi
    Oct 28, 2022 at 23:50

2 Answers 2

2

Templates and some third party extensions can be set up to minify and combine CSS files for better performance so editing the original CSS file may not have any immediate effect. This is also the case when caching is enabled.

Directly editing a CSS file in a template is not considered best practice as a future update of the template will often overwrite the file that was directly edited and the change will be undone.

A better approach for customising CSS is a custom CSS file.

Custom CSS files are often implemented in the template settings or you can install a third party extension to enable a custom CSS file.

You can read more about Custom CSS files at How do I override the CSS styles in my template?

1
  • Thank you, but I'd like to remove many unnecessary CSS because I'm making my personal template, even if I'm using Cassiopea as a base to start with, so adding a custom CSS may not be a solution.
    – Nintendomi
    Oct 28, 2022 at 23:40
0

Probably, I found an answer in this other question: How to force auto versioning of css and js to renew on file change within Joomla! template?

If I understand right, Joomla 4 use a versioning for CSS and JS files, and they can't be changed. Probably, reinstalling the template after my edits on the CSS files could be the solution to make them final. To try them before that, I can use $this->setMediaVersion('');, in the template's index.php file, to temporarily render versioning ineffective.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.