Created
August 16, 2013 20:07
-
-
Save stevewithington/6253117 to your computer and use it in GitHub Desktop.
Mura CMS : Mura has two different methods for get a link to a file stored as an extended attribute. The one you choose depends on if you're expecting the file to be an "image" or a "file" ... if it's not a valid image or file, then the methods will return an empty string, which means you can test for the return value and then output it if it exi…
This file contains hidden or 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
<cfscript> | |
// simple examples | |
fileURL = $.getURLForFile('yourFileID'); | |
imageURL = $.getURLForImage('yourFileID'); | |
</cfscript> | |
<!--- File Example ---> | |
<cfif Len($.getURLForFile($.content('myCustomAttribute')))> | |
<a href="#$.getURLForFile($.content('myCustomAttribute'))#">Download File</a> | |
<cfelse> | |
Not a valid FILE or it doesn't exist. | |
</cfif> | |
<!--- Image Example ---> | |
<cfif Len($.getURLForImage($.content('myCustomAttribute')))> | |
<img src="#$.getURLForFile($.content('myCustomAttribute'))#" /> | |
<cfelse> | |
Not a valid IMAGE or it doesn't exist. | |
</cfif> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment