Thanks again,
I managed to achieve what I needed in a bit of a hacky way, but it works nicely.
I added a textbox that the user can enter the name of the NewsGallery s/he wishes to have attached to the News article.
I then use the following code to produce the image gallery (I have dumbed this down a little for the example)
Code:
@if(!String.IsNullOrEmpty(ViewBag.News.NewsGallery))
{
String folderName = "newsgalleries/" + ViewBag.News.NewsGallery.ToString();
@foreach(dynamic item in ContentHelper.TextFolder(folderName).CreateQuery())
{
<img src="@item.Image" />
}
}
As you can see I have put the directory name in to a string first, because putting it directly in the statement causes the code to bomb out and proclaim CreateQuery() is not a method on TextFolder.