Image not being displayed when creating a Media Type
Hi all,
I have something weird happening when trying to display images from my media section.
Well I created a new Media Type under my settings section with the following type Upload, UmbracoExtenion, UmbracoWidth, UmbracoHeight and UmbracoBytes. To this I added a Tab under which i have an Image Cropper.
So basically the new Media Type created is pretty much the same as the Image Media Type only the name was associated to the project.
But now when I add Macro to the template I somehow can get the Images to display when using the New Media Type. With the custom Image one the images are displayed.
Same issue when creating a Media Type for pdf. I cant possibly display the pdfs created using the Media Type "pdf" but when using the "file" one it works perfectly.
The custom media types should work the same as the built in ones. Normally you will want to keep your "upload" field named "umbracoFile" - did you do that? If not make sure to adjust your macro to read the correct alias of the upload field to show the image/file.
If you are still having problems you can try dumping the XML to a textarea so you can see what's going on with your properties - <textarea><xsl:copy-of select="umbraco.library:GetMedia(xxxx,false())"/></textarea>
If you are still having problems try posting your macro's code here along with the above output. Maybe your macro has a hardcoded reference to "File" or "Image"?
Oh ok, if you are looping from the folder change the false() to true() so it includes the child items.
Then my guess is that your loop is doing something like umbraco.library:GetMedia($mediaFolder/*/@id, true())/File instead of umbraco.library:GetMedia($mediaFolder/*/@id, true())/PDF
Image not being displayed when creating a Media Type
Hi all,
I have something weird happening when trying to display images from my media section.
Well I created a new Media Type under my settings section with the following type Upload, UmbracoExtenion, UmbracoWidth, UmbracoHeight and UmbracoBytes. To this I added a Tab under which i have an Image Cropper.
So basically the new Media Type created is pretty much the same as the Image Media Type only the name was associated to the project.
But now when I add Macro to the template I somehow can get the Images to display when using the New Media Type. With the custom Image one the images are displayed.
Can someone point out why this is not working?
//fuji
Same issue when creating a Media Type for pdf. I cant possibly display the pdfs created using the Media Type "pdf" but when using the "file" one it works perfectly.
Any Suggestion please?
Hi Fuji,
The custom media types should work the same as the built in ones. Normally you will want to keep your "upload" field named "umbracoFile" - did you do that? If not make sure to adjust your macro to read the correct alias of the upload field to show the image/file.
If you are still having problems you can try dumping the XML to a textarea so you can see what's going on with your properties - <textarea><xsl:copy-of select="umbraco.library:GetMedia(xxxx,false())"/></textarea>
If you are still having problems try posting your macro's code here along with the above output. Maybe your macro has a hardcoded reference to "File" or "Image"?
-Tom
Hi Tom,
Well am using the same basic property as the Custom Media Type "File" only the name will change according to the demand of the client.
umbracoFile, umbracoExtension and umbracoBytes. My macro works perfectly when i used the media type (file).
When using
<textarea><xsl:copy-of select="umbraco.library:GetMedia($mediaFolder/*/@id,false())"/></textarea>
Oh ok, if you are looping from the folder change the false() to true() so it includes the child items.
Then my guess is that your loop is doing something like umbraco.library:GetMedia($mediaFolder/*/@id, true())/File instead of umbraco.library:GetMedia($mediaFolder/*/@id, true())/PDF
Yes am using
<xsl:variable name="mediaItems" select="umbraco.library:GetMedia($mediaFolder/*/@id, true())"/>
but when i changed it to
<xsl:variable name="mediaItems" select="umbraco.library:GetMedia($mediaFolder/*/@id, true())/Pdf"/>
I get nothing
That should work, can you post the output of:
<textarea><xsl:copy-of select="umbraco.library:GetMedia($mediaFolder/*/@id, true())"/></textarea>
Here is the output
Tom I got it working...
Here is my mistake
<xsl:for-each select="$mediaItems/File">
Instead i should be using
<xsl:for-each select="$mediaItems/Pdf">
But thanks again for the help.
//fuji
is working on a reply...