Join our community!

Get everything you need to start developing EPiServer solutions.

File Listing Sample Template

March 30 2012, 10:17

What happened with File Listing Sample Template from CMS 5? Anything in CMS 6 R2 templates that is suppesed to replace that sample template? 


  • March 30 2012, 12:37

    Hi Henate,

    I would recommend the built in property Link Collection for that purpose. It can hold any types of links, even files (in the VPP).

  • April 1 2012, 23:06
    Content is edited

    IMHO you should never use anything straight off the sample templates...

    There is a FileDataSource but it usually disappoints me.

    I prefer to collect the files and directories and files my self. Something like this:

    private void GetDirectories(UnifiedDirectory directory)
    {
    foreach (UnifiedDirectory subDirectory in directory.Directories)

    {
    if (subDirectory.QueryDistinctAccess(AccessLevel.Read)) { ...

  • April 3 2012, 19:12

    Hi Henate

    The File Listing sample code is still in the Alloy Tech Sample site. Take a look under /templates/AlloyTech/Units/Placeable/FileList.ascx. When it comes to Johan's comment above about using code from the sample templates I disagree, I use alot of the code from the sample site, but I make sure to understand everything I pull from it before adding it to my projects (as we should with anything we add, always understand everything our code does).

    Hope this helps.

    Frederik

  • April 4 2012, 12:11

    Thanks