This is a video tutorial showing a simple implementation of a File Manager built entirely with DNN Sharp Modules.
When we talk about file management in DNN, the default File Manager has a lot of options but when it comes to configuring it you will notice that you are kinda restricted and you have no options to add your own custom business logic.
We will show you in the video how to overcome this limitation with the help of just 3 of the powerful and flexible DNN modules offered by DNN Sharp: Action Form, Action Grid and MyTokens. You can have the same power offered by the DNN File Manager but also extend it as you want to by using all the cool features of the best DNN modules.
This is just a simple example but it can be extended. Think about this setup is just a starting point for something more complex, where you can add the features both you and your clients need. You are creating your own custom File Management solution by using 3 easy to configure DNN modules.
Where does each module come to help? It's easy:
- Action Grid is used to display data from the database (it is the files "viewer")
- Action Form is used to browse folders and to upload new files
- MyTokens is used to generate HTML with downloadable links for the files based on their ID from the database
The video is based on a key feature from Action Grid called Sync with Url which was detailed in another video tutorial that showed how you can refresh and filter your grids without refreshing the page and can be seen here.
Have a look at the video and make sure you put it in practice for your future custom projects. If you have more complex scenarios to be implemented you can simply book our Implementations Team to build the project for you.
Below you will find the needed SQL Query and the export of the MyTokens custom token as we've built it for this video.
iif(FolderPath = '',
left('/' + FolderPath, len('/' + FolderPath) - 1),
LEN(left('/' + FolderPath, len('/' + FolderPath) - 1)) - CHARINDEX('/', REVERSE(left('/' + FolderPath, len('/' + FolderPath) - 1))) + 2,
LEN(left('/' + FolderPath, len('/' + FolderPath) - 1))
) as Text,
FolderID as Value,
FolderID as ItemId,
ParentID as ParentId,
iif(FolderPath = '', '', '/' + LEFT(FolderPath, LEN(FolderPath) - 1)) as Path,
1 as IsSelectable,
IIF((Select count(*) from Folders F where F.ParentId = Fol.FolderId) > 0, 'true', 'false') as HasChildren
from Folders Fol
where PortalID = 0 and
(ParentID = @parentId and @parentId != -1)
(ParentID = 36 and @parentId = -1)
(@searchText != '' and (FolderID = @searchText or FolderPath like '%' + @searchText + '%'))
Exported MyTokens custom token