Skip to content

Instantly share code, notes, and snippets.

View a2life's full-sized avatar

a2life

View GitHub Profile
@a2life
a2life / rowTpl (for newOrUpdate)
Created August 17, 2012 20:01
modx Wayfinder rowTpl to be used with neworUpdate snippet (gist:3365056)
<li [[+wf.id]] [[+wf.classes]] >
<a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>
[[+wf.linktext]][[!newOrUpdate? input=`[[+wf.docid]]`]]</a> [[+wf.wrapper]]
</li>
@a2life
a2life / NeworUpdate
Created August 16, 2012 00:39
ModX snippet to examine resource creation/modification date and attache "new" and/or "update" image if newer than 30 days
<?php
/**
* This is a MODX snippet to add "new" or "Updated" images to menu,
* pages and such.
* You need to provide your own new.gif and updated.gif file. change the
* file path to the images files accordingly.
* if called without input parameter then it will look at the page resource and
* determine if the page is newly published or updated.
* if called with input=`resourceID` then it will look into that resource ID.
* This snippet can be also used with getResoruces or Wayfinder.