Image gallery thumbnails add css class if "new" image
How can I add a CSS class to an Image gallery thumbnail, if the image is a recent or new image uploaded to the gallery?
I want to add a CSS class "new" to the image, and have that appear on the image for 60 days. Is there a way of doing this using the publish date? I'm guessing some jQuery or C# code will be needed to work out the 60 days functionality.
umbraco.library has some built in Date functions you can use for this, DateDiff should help you. Just took a quick look, and with some help from this thread, the below should work. Couldn't figure out how to get it to return days, but you get the idea :)
Image gallery thumbnails add css class if "new" image
How can I add a CSS class to an Image gallery thumbnail, if the image is a recent or new image uploaded to the gallery?
I want to add a CSS class "new" to the image, and have that appear on the image for 60 days.
Is there a way of doing this using the publish date?
I'm guessing some jQuery or C# code will be needed to work out the 60 days functionality.
Can anyone suggest some ideas?
Cheers,
JV
umbraco.library has some built in Date functions you can use for this, DateDiff should help you. Just took a quick look, and with some help from this thread, the below should work. Couldn't figure out how to get it to return days, but you get the idea :)
... where $media is a variable with the current media node XML.
-Tom
is working on a reply...