Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1465

Administration Joomla! 5.x • How can I add a version number to child template css?

$
0
0
In a custom (non-child) template I have the following code for my template.css:

Code:

JHtml::_('stylesheet', 'template.css', array('version' => $version, 'relative' => true));
This adds a timestamp to the CSS file so that when it's loaded, it's always the latest version. Perfect for development.
When hovering over the css file name in a browser Inspector, it looks something like "mydomain/templates/mytemplate/css/template.css?1715706903:13"

I am now having a go at creating a Cassiopeia child template, but can't work out how to do the same for the new user.css file at media/templates/site/cassiopeia_myNewTemplate/css/user.css

I've tried this:

Code:

JHtml::_('stylesheet', 'media/templates/site/cassiopeia_myNewTemplate/css/user.css', array('version' => $version, 'relative' => true));
and this:

Code:

JHtml::_('stylesheet', '/media/templates/site/cassiopeia_myNewTemplate/css/user.css', array('version' => $version, 'relative' => true));
(the difference being the / before media) to no avail.

Can anyone tell me what do I need to do, please?

Statistics: Posted by GillianBPP — Thu Jun 06, 2024 5:17 pm



Viewing all articles
Browse latest Browse all 1465

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>