Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

File Listing Sample Template

Vote:
 

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

#57842
Mar 30, 2012 10:17
Vote:
 

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).

#57847
Mar 30, 2012 12:37
Vote:
 

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)) { ...

#57871
Edited, Apr 01, 2012 23:06
Vote:
 

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

#57933
Apr 03, 2012 19:12
Vote:
 

Thanks

#57941
Apr 04, 2012 12:11
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.