Shape 1 Shape 2 Shape 3

Post Downloads

Users are able to add documents to a post in the form of downloads. In liquid we are able to loop over the downloads and present them to the members as a link to get the resource.

{% if post.downloads.count > 0 %} {% for download in post.downloads %} <a href="{{ download.url }}">{{ download.display_name }}</a> {% endfor %} {% endif %}

Kajabi accepts a number of file types for file downloads and as the developer you are able to tap into that information and display things such as icons according to the downloads file type. Below is an example of this using Font Awesome icons to show the download type.

{% if download.extension == '.doc' or download.extension == '.docx' %} <i class="fa fa-file-word-o" aria-hidden="true"></i> {% elsif download.extension == '.gif' or download.extension == '.jpeg' or download.extension == '.jpg' or download.extension == '.png' %} <i class="fa fa-file-image-o" aria-hidden="true"></i> {% elsif download.extension == '.mp3' or download.extension == '.wav' or download.extension == '.m4a' or download.extension == '.wma' %} <i class="fa fa-file-audio-o" aria-hidden="true"></i> {% elsif download.extension == '.mp4' or download.extension == '.mov' or download.extension == '.3g2' or download.extension == '.3gp' or download.extension == '.avi' or download.extension == '.flv' or download.extension == '.mpg' or download.extension == '.ogv' or download.extension == '.wmv' %} <i class="fa fa-file-video-o" aria-hidden="true"></i> {% elsif download.extension == '.zip' %} <i class="fa fa-file-archive-o" aria-hidden="true"></i> {% elsif download.extension == '.xlsx' or download.extension == '.xls' %} <i class="fa fa-file-excel-o" aria-hidden="true"></i> {% elsif download.extension == '.pptx' or download.extension == '.ppt' %} <i class="fa fa-file-powerpoint-o" aria-hidden="true"></i> {% elsif download.extension == '.txt' or download.extension == '.rtf' or download.extension == '.odt' %} <i class="fa fa-file-text-o" aria-hidden="true"></i> {% elsif download.extension == '.html' %} <i class="fa fa-file-code-o" aria-hidden="true"></i> {% elsif download.extension == '.pdf' %} <i class="fa fa-file-pdf-o" aria-hidden="true"></i> {% else %} <i class="fa fa-file-o" aria-hidden="true"></i> {% endif %}

Here on the UX Team, we are so grateful for your time and we look forward to making the process of developing Kajabi themes simpler than ever before!

If you have any questions, feel free to reach out to us at themes@kajabi.com

Join Feedback Community

Enter your email below so that we can give you access to the Theme Developer Feedback Community.