Developer forum

Forum » Templates » File publishing a list of items

File publishing a list of items

Lise T. Pedersen
Reply

I need to create a sort of gallery, based on a folder of pdf-files, which has to be shown as pictures. Therefore, I can't use the ordinary gallery, but need to build it with items. But I don't really understand how to get it working :-)

I have created a folder item - but how do I exactly make my template able to show the content of the folder, I am pointing at - like e.g. the file publish module does?

Have found the Item.[Mappe].ListOfFiles loop, but I can't figure out exactly how to make it output anything...

I hope someone can help me...

/Lise


Replies

 
Merethe Vrå Andersen
Reply

Hi,

In ListOfFiles loop you have various tags for the files in the folder, e.g. FileName:

<!--@LoopStart(Item.[ItemFieldSystemName].Value.ListOfFiles)--> <p><!--@Item.[ItemFieldSystemName].Value.FileName--></p><!--@LoopEnd(Item.[ItemFieldSystemName].Value.ListOfFiles)-->

Images placed in the Designs folder:

    <!--@LoopStart(Item.Folder.Value.ListOfFiles)--> <p><img src="<!--@Item.Folder.Value-->/<!--@Item.Folder.Value.FileName-->"></p> <!--@LoopEnd(Item.Folder.Value.ListOfFiles)-->
    

Combined with global tags (if images are placed outside design folder, where the page template is located):
    <!--@LoopStart(Item.Folder.Value.ListOfFiles)--> <p><img src="http://<!--@Global:Request.Host--><!--@Item.Folder.Value-->/<!--@Item.Folder.Value.FileName-->"></p>
    <!--@LoopEnd(Item.Folder.Value.ListOfFiles)-->

Kind regards,
Merethe

 

You must be logged in to post in the forum