News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

Layout to show multiple sub category titles and the files inside

Started by Axiom, 11.02.2016 17:33:25

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Axiom

Hi all, I use jDownloads quite a bit, and normally styling is pretty straight forward, but in this case, I have a client who wants to see the files in multiple sub categories all at once, rather than just a "sum" count of them.
so : we have a category title of "Main Category", inside that we have two sub-categories: Sub1 and Sub2

inside those we have three files each (file1, file2, file3).

in joomla we set the main menu link to show "Category" and we select the category.

When joomla renders the link, the layout would show :

Main Category Name {cat_name}
some text about it maybe {cat_text}

Sub1 Title {sub_catname}      Sub2 Title {sub_catname}
file1 {file}                            file1 {file}
file2 {file}                            file2 {file}
file3 {file}                            file3 {file}


So effectively, I'm trying to have a page render the "category" layout - but with the option to have more than one category at once.
We can already have it calculate all the sub-categories, and count the sum of the files within the subcategories,
is there any way to have it actually display the subcategory names as download links too?
  •  

ColinM

Hi
You make it sound simple!! But...
This is not straight forward as the Category layouts do not support the {url download} macro.  You could however use the jd Content plugin in the Category Description to list the Downloads in a specific category.
See http://www.jdownloads.net/documentations/item/overview-and-installation-notes-for-jdownloads-plugins
which includes a brief description of the jD Content plugin - think you will need the form
{jd_file category==15 count==0} will list all the Downloads in the category with ID 15.
I have attached a zip file with one of the new layouts we are about to release which just outputs the downloads title as a link.  Unzip and then you can import into the files layouts.  You will probably need some extra css to put into columns.  Will assist if you need it.

Colin



[gelöscht durch Administrator]
Colin M
  •  

Axiom

Hi Colin, thanks for getting back to me!
What do you mean it's not simple?!? ha ha
I appreciate the pointer to the content plugin, I hadn't considered that route - so I'll try that and see how it works out.
It's a completely ridiculous request, one of the most foolish I've ever really had really... Especially since all the sub categories contain varying numbers of files - it's simply going to look like a mess no matter how well it may turn out to "work" as the client wants.
i was also using a layout very similar to the one you sent me :
<div id="downloadsWrap" class="span4">
         <div id="downloads">
         <h6>  {file_title}  {pic_is_updated}</h6>
         </div>
</div>
  •  

romagromov

Best free windows software for your PC at bestwinsoft.com
  •  

Axiom

Yup... after a short experiment, this is what I need to do - use the content plugin - it will allow me to create an article, add css and div formatting, and have the {plugin bits} do the work to pull the category FILES - but I will have to manually make the category names....

Something like this :

<div id="downloadsWrap" class="span4">
   <div id="downloads">
      <h5>First Manual Title</h5>
      <p>{jd_file onlinelayout==Files just link V3.2}{jd_file category==15 count==0}</p>
   </div>
</div>
<div id="downloadsWrap" class="span4">
   <div id="downloads">
      <h5>Second Manual Title</h5>
      <p>{jd_file onlinelayout==Files just link V3.2}{jd_file category==16 count==0}</p>
   </div>
</div>

and so forth to list all the sub categories - but this is going to be tedious lol

however - Colin... it would seem to me that the option in "category" (not categories) should be able to do this without a freakish amount of coding - much like joomla having blog and category view styling built into the display of articles.... The plug in already allows the manual selection of the categories - so it wouldn't be much of a stretch to have the option to pick from available categories and automate the process.

But again, I don't really like displaying the files like this for large amounts of sub categories like the client wants - but it does have some merit to have the option to have a single page show related sub category titles and files - and have the option for the layout feature.
  •  

ColinM

Hi
Glad that the basic mechanism works. Actually you should be able to put the code for a specific category in the category description itself.
So how to automate better!

It is tempting to give the jD Content module the ability to select the relevant Category by name but that is not unique, so it would need to have a pull down capability. Think on balance thast is not such a good idea because of existing usage but maybe worth considering.

There is a module called Related which does list the Downloads in the same category but this is presently restricted to only show in the Details.  In order to show the Related Downloads then one includes the placeholder {loadmodule mod_jdownloads_related} in the Details Layout.  So to me a better prospect is to allow the Category layout to support {loadmodule mod_jdownloads_related} as that should provide the basic capability.  The Related Module does need some re-working as presently it generates a <table rather than a <div structure, showing in an <ul with class set for vertical or horizontal seems a useful way forward.

Will discuss with Arno.

Colin

PS Incidentally I would suggest you modify your code to use classes rather than ids as technically the id should be unique on  a rendered page.
<div class="downloadsWrap span4">
Colin M
  •