By Documents you mean document type or from Media folder?
If from media folder you could create a new Media Type "Documents" under the Settings section which you will be using in the Media Section to upload your documents.
If you're using Umbraco 4.8+ or have uComponents installed how about:
Document parentDocument = new Document(123);
foreach (Document childDocument in parentDocument.GetChildDocumentsByType("docTypeAlias"))
{
// Do Something...
}
(The above uses uQuery extension methods, which can be found in the umbraco namespace if using 4.8+ or otherwise within uComponents.Core.uQueryExtensions)
Documents - Getting all of a documents children (as document) of a certain type only!
Hi guys,
I need help to find all the child documents of a document but of a certain type.
I can do this easily with nodes but with documents it seems much harder to achieve.
I can do the following in nodes:
For Each child As Node In nodeContactSet.Children
If child.NodeTypeAlias = "DocTypeAlias" Then
'Do something
End If
Next
Is there an easy way to do the same thing with documents ?
Hi Craig,
By Documents you mean document type or from Media folder?
If from media folder you could create a new Media Type "Documents" under the Settings section which you will be using in the Media Section to upload your documents.
Your XSLT will be something like
Hope it makes helps
//Fuji
Hi Craig,
If you're using Umbraco 4.8+ or have uComponents installed how about:
(The above uses uQuery extension methods, which can be found in the umbraco namespace if using 4.8+ or otherwise within uComponents.Core.uQueryExtensions)
HTH,
Hendy
Thanks for your help guys. I particularly like your solution Hendy and it works brilliantly well.
Thanks,
Craig
is working on a reply...