Date Tags rtfm / modx

This is my first weekly (hopefully) post about stuff I've learned/realized through the week. Hopefully there will be enough to make this somewhat valuable. And if nothing else, I can browse back through and remember stuff if I need it. Things will probably revolve mostly around MODx Revolution, with a healthy sprinkling of other little gems thrown in for good measure.

As a disclaimer... I can not promise that everything will work exactly as intended, and I may very well be wrong about how to go about doing some things I describe. If you have a better way, let me know. If something doesn't work... well... it must have, at least for me! haha

6-14

When using MODx Revolution output filters: strtotime needs to be used if your going to use date, otherwise date won't get a properly formatted date string and strange things can occur. This code sample was taken from the Revo docs, and is a good example of not only using these two filters together, but also filter chaining in general.

[[+mydate:strtotime:date=`%Y-%m-%d`]]

6-15

Not only Apple hates flash. Well, that isn't fair IE doesn't hate flash, it just doesn't like doing things you sometimes take for granted with other browsers. Our example today came about when my boss was trying to add some videos he'd made to a product's page. Well, of course, the video couldn't be on the page, unless you were watching it, and any sort of pop-up was a bad idea (although most of the content loading from an iframe and the layout being constructed purely from tables and devoid of CSS was a good idea?). I better not get started on my CSS war here at work. So anyway, I whipped up a quick little hide/show video button for him with jQuery and off we go. Well, about 30 minutes later someone views it in IE and realizes the sound just keeps playing even after you hide it. Crazyness... oh and about this time he'd managed to add a second video they wanted so you could end up having audio from both playing at the same time. So, my solution you may ask? I said, "Screw you IE" and completely removed the from inside the little div holding the movie. That worked wonderfully, so there you have it. $('.movie').html(''); will fix all your problems. Although, if you want to be able to show the video later without reloading the page you should probably save the contents of the container.

var movie = $('.movie').html();
$('.movie').html('');

6-17

Today I realized my projects won't continue to code themselves if I goof around for a while, although, I guess that is a good thing, you know, job security and all. I tend to jump around if I'm not paying attention, so I certainly have to try to keep myself focused on completing tasks in order before jumping to the next thing that seems fun.


Comments

comments powered by Disqus