Which Layout is used where?

Introduction

Layouts control how jDownloads shows Categories and Downloads on the front end.  They are very flexible and allow customising in a simple and practical manner.

The objective of this article is to show which layout or part of a layout is used when showing jDownloads Categories and Downloads.

There are seven layout types as listed below.  Only one layout of each type is the 'activated' one.

Which layout is used

Which Layout is used depends upon how the view was called.

There are up to six parts in a layout
The four principle parts are the Header, the Sub-header, the Main part and the Footer.  In a layout the Main part may be used multiple times.

Showing Download Details, Summary or Search

When showing the Download Details, Summary or Search views then it is quite straight forward:

Showing List All Categories

Another straight forward situation is when using the List all Categories menu item.  This always uses the active Categories layout such as illustrated below.  In this example it was a Catergories layout "Categories Example with 4 columns".  Note that some details of the view are dependant upon the Options Front End tab settings.  For instance in the example below the option 'Number of entries per Categories page' was set at 6.  So as the test site used in these examples has 10 top level categories, then six are shown on the first page and the other four would be on the next page.  For reference the actual setup values used in this article are noted at the end of this article in Options Setup
layouts which01

Other views

For other views which Layout is used depends upon how the view was called.  For example if we click on say Public Downloads in this example the next view would be like the one below.
Note that now the view is made up from parts of several different active layouts, some from the Category layout, some from the  Sub-categories layout and some from the Downloads layout.  This may appear to be strange but it is to ensure consistency of style throughout.  For instance all Downloads are shown using the relevant part of the Downloads layout.  As there are three subcategories then the Sub-categiries 'main' part is used three times, That is it is used once per subcategory being shown.
 
layouts which02
If next we were to click on the topcat-sub1 link the view would be very similar to the one above except it would show a different number of sub categories and Downloads. But clicking on topcat-sub1a has no categories so its view is shown below.  This time there are no subcategories but two Downloads so the main part is used twice.
layouts which03
 Another thing to notice in the above is that there is a 'Files title' section.  This is actually at the start of the Files Main section and has special coding to ensure it is only used once per page.

Appendix: Options Front End Tab Setup Details

In the above examples the settings for various configuration values in the Front End section of the Options are as shown below.
For details of all the front end option see the article A Tutorial on Front End Options (opens in a new window/tab)

Options Settings
Front End Parameter Value  
Number of Categories to show per page * 6 Allows you to specify the maximum number of category entries that will be displayed per page by the front-end.
Number of Downloads to show per page * 6 Allows you to specify the maximum number of Downloads entries that will be displayed on each page by the front-end.
Categories default frontend sort order Title Reverse Alphabetical Select the default frontend sort order for Categories. Select 'Categories Manager Order' to use the backend default order.
Downloads default frontend sort order Title Alphabetical Select the default frontend sort order for Downloads. Select 'Downloads Manager Order' to use the backend default order.
Use files title as download link Yes When this option is set to Yes then the download title will be a link that starts the downloading process.
Show navigation at the top Yes If set to Yes, a page navigation bar for the 'downloads' is displayed at the top of the page.
Show navigation at the bottom Yes If set to Yes, a page navigation bar for the 'downloads' is displayed at the bottom of the page.
Show navigation for Subcategories Yes If set to Yes then an extra field is shown below allowing you to specify the 'Number of Subcategories/Page'. A subcategories navigation bar will be displayed in the front end view.
Number of Subcategories 4 Allows you to select the maximum number of subcategories that will be displayed per page.
Show empty Categories Yes If set to Yes then all categories are shown including those without any Downloads.
 
Colin Mercer, December 2019, modified March 2021
 

Tags: index

Print