Search

This is a simple extension that lets you get the file modification time.

Useful when you need to prevent caching of some files (mainly css).

Check out http://github.com/rainerborene/datestamp_helper/tree/master

Example:

<link href="{$workspace}/stylesheets/screen.css:datestamp" media="screen, projection" rel="stylesheet" type="text/css" />

Result:

<link href="http://localhost/rainerborene/workspace/stylesheets/screen.css?1248022788" media="screen, projection" rel="stylesheet" type="text/css" />

Pretty simple, huh?

@rainerborene - Thanks! This will be really helpful.

Awesome. I’ve been meaning to build exactly this, only my way would have been less elegant and less useful :/

I’ve found using the $today and $current-time parameters (concatenated, and punctuation removed if you fancy) does the same trick.

@nickdunn Not the same because it gets the file modification time.

Duh! I completely missed that. In which case — bravo, this is incredibly useful :-) Before I would manually change datestamps in my master.xsl after making an update.

Yes, this extension is strikingly simple and useful alike! Thank you, rainerborene!

I have many websites using version numbers for CSS and JS files to overcome caching problems. I always hated this. Problem solved with the ingenious Datestamp Helper.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details