I'm creating a gallery which will list all images from a media folder. I can't figure out how to get the images following the new XSLT schema. I have a working gallery on Umbraco < 4.5 which I have tried to follow, but with no luck.
But, unfortunately I still can't get it to work :-/ - can you be a little more precise? Maybe you can construct an example of a link to each image from the galleryFolder?
Another question. Will an Alias of a docType conflict with the property Alias of another docType if they are the same?
you should probably follow Chriztian's example though as it's got better error checking going on with normalize-space and [not(error)] I'm not familiar with those myself so haven't included them in my example
I think I have mixed something up when it comes to using my Document Types and so on regarding the gallery.
Example of my content tree:
Content -- Homepage ---- Gallery (document type GalleryFolder) -------- Gallery 1 (document type GalleryItem)
The GalleryItem document type has the Gallery 1 media folder selected. The Alias for the mediapicker (document type GalleryItem) is imgFolder (has just changed that to ensure it wont conflict with other names/alias)
I can't really make any sense of it right now - considering to remove all and start over :-/
in that second example I gave, make sure that the getmedia call uses true() rather than 'true' Also make sure you save and publish any nodes once you've changed any doctype or property aliases.
does the above give you anything in the <textarea></textarea> tag? I think you're on the right track, so bear with us, I'm sure we'll have the problem cracked soon
OMG, so much trouble corrected with such a simple fix...!
At first I wasn't getting any results with the code-snippet from your previous post. I then changed the $currentPage/imgFolder to another Alias which selects a particular image from the gallery to be shown on the page which lists all galleries. Then I saw the copy-of info about that particular image.
I then refreshed the cache which partially solved my problem, since I then was getting results on one gallery-page. I might have added the images after I changed the Alias which caused the rest of the gallery images not to show?
Do you follow a particular scheme when naming Aliases, document types and so on? I think that have been the source to my trouble from the very beginning, since I found a document type called GalleryFolder (which lists all galleries) and an Alias on another document type (GalleryItem) called galleryFolder.
Problems
Hi.
I'm creating a gallery which will list all images from a media folder. I can't figure out how to get the images following the new XSLT schema. I have a working gallery on Umbraco < 4.5 which I have tried to follow, but with no luck.
I have written this as a reference:
Which shows the following when rendered on the page:
I have tried many things to get the images to show, and this is the approch I'm working on now:
Please help - or all my hair will soon be gone...
Hi Stefan,
Media items don't get the isDoc attribute, so that's your nightmare item right there - here's something that should work:
/Chriztian
Thank you for your reply.
But, unfortunately I still can't get it to work :-/
- can you be a little more precise? Maybe you can construct an example of a link to each image from the galleryFolder?
Another question. Will an Alias of a docType conflict with the property Alias of another docType if they are the same?
Thank you in advance!
Hey Stefan,
What's not working for you in Chriztians's example?
what does the following give you?
or assuming that the node you mentioned (1176) is a media folder
this should do the trick
you should probably follow Chriztian's example though as it's got better error checking going on with normalize-space and [not(error)] I'm not familiar with those myself so haven't included them in my example
cheers,
- Tim
I have now tried to follow your examples. The last one didn't render anything.
Your first example rendered the name of the folder in which the images are stored.
Example (from media section):
Your example would render "Gallery 1".
I think I have mixed something up when it comes to using my Document Types and so on regarding the gallery.
Example of my content tree:
The GalleryItem document type has the Gallery 1 media folder selected.
The Alias for the mediapicker (document type GalleryItem) is imgFolder (has just changed that to ensure it wont conflict with other names/alias)
I can't really make any sense of it right now - considering to remove all and start over :-/
Hi again Stefan,
maybe your xml cache needs refreshing? right-click on content and choose republish entire site
or anternatively you can do it via this url http://YOURDOMAIN/Umbraco/dialogs/republish.aspx?xml=true
in that second example I gave, make sure that the getmedia call uses true() rather than 'true'
Also make sure you save and publish any nodes once you've changed any doctype or property aliases.
does the above give you anything in the <textarea></textarea> tag?
I think you're on the right track, so bear with us, I'm sure we'll have the problem cracked soon
- Tim
OMG, so much trouble corrected with such a simple fix...!
At first I wasn't getting any results with the code-snippet from your previous post. I then changed the $currentPage/imgFolder to another Alias which selects a particular image from the gallery to be shown on the page which lists all galleries. Then I saw the copy-of info about that particular image.
I then refreshed the cache which partially solved my problem, since I then was getting results on one gallery-page.
I might have added the images after I changed the Alias which caused the rest of the gallery images not to show?
Do you follow a particular scheme when naming Aliases, document types and so on? I think that have been the source to my trouble from the very beginning, since I found a document type called GalleryFolder (which lists all galleries) and an Alias on another document type (GalleryItem) called galleryFolder.
is working on a reply...