Created
January 9, 2014 18:55
-
-
Save modmedia/8339802 to your computer and use it in GitHub Desktop.
Method on displaying Mura extended attribute images, including custom image sizes
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
<!--- Assuming you've created an extended attribute 'File' type called 'extAttributeImage' ---> | |
<!--- In a Mura Page Template ---> | |
#$.createHREFForImage(filename=$.content('extAttributeImage'),size='myCustomSize')# | |
<!--- In a Mura Component ---> | |
#$.createHREFForImage(filename=$.component('extAttributeImage'),size='myCustomSize')# | |
<!--- In the context of an iterator ---> | |
#$.createHREFForImage(filename=item.getExtAttributeImage(),size='myCustomSize')# |
Hello,
you are correct, in Mura 7 to get image url from with extended attribute image:
$.createHREFForImage(fileid = item.getValue('extAttributeImage'))
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
I know this was a long while ago, just wanted to say I stumbled across this when double-checking how to do this, took me a while to realise that it should actually be using the 'fileid' variable name rather than 'filename', otherwise you get a blank return from the function.
This is in the latest Mura 7, so appreciate things are very different now than 3 years ago :)
Cheers,
Peter