Building a WordPress Download Manager Link Template from scratch

Link Template renders the view of WordPress Download Manager package shortcode. When a shortcode ( e.g. category short-code ) displays multiple packages link template controls the view of single package in the list.

WordPress Download Manager Pro comes with a wide range of link templates. You can always choose from these predefined template file to use with your shortcodes. But sometimes built-in templates may not be enough for your specific use case. Custom Link Template is the answer in this situation.

You can create a Custom Link Template from scratch or edit already available templates by cloning them from Dashboard >> Downloads >> Templates page.

Now, we are going to build a Custom Link Template from scratch. Link Template is the combination of raw HTML codes and template tags. The template tags represent various data of the package. For example, [title] template tag shows the package name. You will find the list of available template tags in Template Editor Sidebar (  Dashboard >> Downloads >> Templates page ). These tags are listed here too.

Let’s get started. First look at the design that we will follow to make our Custom Link Template.

To create the custom link template go to Dashboard >> Downloads >> Templates page. Click on “Create Link Template” from the top bar. You will be redirected to a new page named “Template Editor”. The list of template tags available at the right side of the editor.

First, give a title for the template so you can recognize it later. Now I am using the following code for our design. I used Bootstrap 3 “Panel” to make this template. You can use anything here to make your own structure. To add the style you can use a CSS block above the code. You can also insert template tags from the dropdown list of “Package info” or “Package Meta” above the editor.

You can click on the preview to see the link template preview instantly. Notice those template tags [version], [download_count], [download_link] etc. Those tags will be rendered to actual values in the frontend.

Now save the template and use it when inserting the shortcode in a page or post. To use this template as a default template for a package, go to “Package Settings” meta box in the edit package page and select this custom link template in ‘Link Template’ option.

That’s it. You have just built your first custom link template.


Comments [ 4 ]

Leave a Reply