Last active
June 1, 2016 23:02
-
-
Save murtaugh/cb0700106b191a4e3027 to your computer and use it in GitHub Desktop.
Convince ExpressionEngine to show SVG thumbnails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# redirect requests to (non-existent) SVG thumbnails to the main image | |
RewriteRule ^/assets_content/_thumbs/?\.svg$ /assets_content/$1.svg [NC,L] | |
# FWIW, I had to swap out the ? for (.*) in my environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* make sure the svg thumbnail doesn't blow out the page; give it a checkerboard background */ | |
.publish_field .filename img[src$=".svg"] { | |
width: 100px; | |
max-width: 100%; | |
padding: 12px; | |
background-color: rgba(0,0,0,.05); | |
background-image: linear-gradient(45deg, rgba(0,0,0,.05) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.05) 75%, rgba(0,0,0,.05)), | |
linear-gradient(45deg, rgba(0,0,0,.05) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.05) 75%, rgba(0,0,0,.05)); | |
background-size: 40px 40px; | |
background-position: 0 0, 20px 20px; | |
} |
FYI, for Dreamhost I had to remove the leading /
:
RewriteRule ^assets_content/_thumbs/?\.svg$ /assets_content/$1.svg [NC,L]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice! Glad you got it working!