27 Feb 2018

#29: Create your own slider module

How to build your own slider "module" with its own admin panel.

Last week we had a couple problems with one of the Slider Modules available on the DNN Store: it was opening connections to DB and was never closing them which led to slow websites as all other modules (and DNN requests) were waiting in queue as the DB connections were all (>95%) taken by this slider module.


So we asked the client: Why didn't you use MyTokens to create your own sliders?... would have saved both you and us a couple of days of investigations, not to mention that would have saved your clients a long time of slow websites. And YES you can render a slider with MyTokens :).


But that's another story, let me tell you about how you can build a slider "module" with MyTokens and also create an admin panel with Action Grid.


If you ever used MyTokens you already know that it is a very and I mean very capable module as it does pretty much anything that can be done:

  • connects to database to get data (even to external databases not just local ones)
  • can even connect to APIs to get data (makes server requests)
  • can read and write files from disk (with a little extra work needed to create your custom tokens that do that)
  • render HTML based on either static or dynamic content, that can be brought directly from the database (here's a tutorial on how to render html tables)
  • and many others... (more tutorials can be found here)
What we did in this tutorial is to:

  • use a carousel bootstrap template and make a Razor Script out of it which will be rendered with MyTokens
  • create a custom token to retrieve data from the database which will be used to populate the sliders (image urls, titles, descriptions, etc.)
Now that you have your slider up and running you might want to consider installing Sharp CDN as well as it can drastically improve the loading speed of your website as you can see in the video tutorial here.


Do you feel that your website is running slow or want to see if it can perform even better? Put us to a test and accept this challenge: Get a faster website or win $1,000!

Latest Posts from 1001

29 Aug 2019

#66: Manipulate Cookies with MyTokens

9 Aug 2019

#65: Google Maps Location Picker with markers and radius

16 Jul 2019

#64: How to Build a File Manager