Skip to main content
Post Undeleted by Goose
Completely new answer.
Source Link
Goose
  • 428
  • 5
  • 19

I found a module that while this will check for the file, will not find it because of theappend a query string, to the end of all CSS and will not work.JS in xml layouts. The query string is configurable from the admin.

<action method="addCss"><stylesheet>css/style.css?1.1.1</stylesheet></action>

https://github.com/mklooss/Loewenstark_Head

That this does workThe basic idea is to override _prepareStaticAndSkinElements to include a query string, as it does not check fordone in the file firstmodule, shown below.

<actionprotected method="addItem"><type>skin_css<function &_prepareStaticAndSkinElements($format, array $staticItems, array $skinItems, $mergeCallback = null)
{
    $version = Mage::getStoreConfig("design/type><name>csshead/style.cssmeta_version_tag");
    $format = sprintf($format, "%s?1.3.2</name><params/></action>v{$version}", "%s");
    return parent::_prepareStaticAndSkinElements($format, $staticItems, $skinItems, $mergeCallback);
}

I found that while this will check for the file, will not find it because of the query string, and will not work...

<action method="addCss"><stylesheet>css/style.css?1.1.1</stylesheet></action>

That this does work, as it does not check for the file first.

<action method="addItem"><type>skin_css</type><name>css/style.css?1.3.2</name><params/></action>

I found a module that will append a query string to the end of all CSS and JS in xml layouts. The query string is configurable from the admin.

https://github.com/mklooss/Loewenstark_Head

The basic idea is to override _prepareStaticAndSkinElements to include a query string, as done in the module, shown below.

protected function &_prepareStaticAndSkinElements($format, array $staticItems, array $skinItems, $mergeCallback = null)
{
    $version = Mage::getStoreConfig("design/head/meta_version_tag");
    $format = sprintf($format, "%s?v{$version}", "%s");
    return parent::_prepareStaticAndSkinElements($format, $staticItems, $skinItems, $mergeCallback);
}
Post Deleted by Goose
Source Link
Goose
  • 428
  • 5
  • 19

I found that while this will check for the file, will not find it because of the query string, and will not work...

<action method="addCss"><stylesheet>css/style.css?1.1.1</stylesheet></action>

That this does work, as it does not check for the file first.

<action method="addItem"><type>skin_css</type><name>css/style.css?1.3.2</name><params/></action>