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

Override View Categories

Started by elisa, 29.09.2017 11:28:24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

elisa

Hi there!
I need to view all categories exept one. For that i created an view and added this line into the override.    unset($this->items[0]);
It helped at least a bit - But it still shows an empty box of the category. How can iI exclude categories from this view? I need this because of routing conflicts (This category belongs to another website section).

Thank you!

Elisa

Auf Deutsch:
--- Ich möchte eine Kategorieübersicht anzeigen aber eine ausschließen da ich sonst Probleme mit dem Routing habe. Ich habe versucht die eine Kategorie aus dem Array zu nehmen indem ich unset($this->items[0]); bzw unset($cats[0]); gesetzt habe aber das hat mich nicht zum Ziel gebracht. Kannst du mir sagen wie ich im categories layout einzelne Kategorien ausschließe, bzw definiere welche Kategorien eingebunden werden sollen ? Danke!
  •  

ColinM

Elisa,
Maybe a better way is to use the view access level method rather than an override.  Or maybe the Permissions route.
You say the category belongs to another part of the website but, regrettably, I do not understand what you mean.  Could you perhaps explain a little more please.
Colin
Colin M
  •  

elisa

Hi Collin,
thanks for helping me.

I have a "Download Area for Customers" and a "Download Area for Employees".
If I am in the Employee Area and use the breadcrumbs navigation I end up in the "customer area" instead of the "employee area".
That is because the "Employee Downloads" are listed in the All Categories View of Jdownloads (=Customer Area) and the routing thinks this is the root.

So i need to create a view where these both are seperated. For employees it´s easy because it´s a single category, but for customers there are 5 categories and there is no view for multiple categories. Just 1 or all.

Hope you know a solution - Thanks again,

Elisa

  •  

ColinM

Elisa, 
Do either the Employees or the Customers, or both, need to login?  If so there are simple solutions.  Are the areas 'confidential' to each group? Or could it be OK for example Employees see Customer Downloads?  By knowing the above than access can be controlled quite simply.

A part of the solution is that in jD if you use a menu item show a single category then it will show all the sub categories.  In my demo site I have a top level category called 'topcat-sub1' with many sub cats and another top level category called 'topcat-sub2', also with its own sub-cats.  A single category menu link to say 'topcat-sub1' only shows the sub cats of 'topcat-sub1'
Colin
Colin M
  •  

elisa

Hi Colin,
thanks again!
Currently, it´s like that:

JDownloads Categories:
- Broschures
- Documents
- Downloads for Registered Users
- General Stuff
- Employee Downloads

Menu:

- Customer Downloads (public) (shows all Categories)

- Member Area (closed)
-- Downloads (closed shows Employee Downloads)

When I log in the Member Area and click on the Downloads, navigate through the subcategories, the breadcrumbs root starts in the Customer Downloads. Obviously, because the Customer Downloads contain the Employee Category too and the routing got confused.

So I thought to move the Categories of jDownloads like this:

- Customer Downloads
- - Brochures
- - Documents
- - Downloads for Registered Users
- - General Stuff

- Employee Downloads

But in jDownloads I have only two views: one category or all categories. If I use the changed structure and use the one category view on Customer Downloads my layout is completely broken. So I moved the categories back to the initial state:

- Brochures
- Documents
- Downloads for Registered Users
- General Stuff
- Employee Downloads

And would need to exclude the "Employee Downloads" category from the "Customer Download page", otherwise the breadcrumbs are always messed up.
Can you maybe post a link to your demo page?

Thanks a lot !!!

Elisa
  •  

elisa

Hi Colin,
I managed to display the categories now, how you described. I had to create a new view for category and then this worked.
But the breadcrumbs still don´t work. If I dive in deeper then the 3rd level ob subcategory the breadcrumbs only show "Home" at the top.

I try to investigate further why this happens.

Thanks a lot,

Elisa
  •  

ColinM

#6
Elisa
I was actually referring to my test site rather than a demo site - it is on an XAMPP server on my PC so not on the real web - easier to change/check code.
I had slightly missed the point that it was the breadcrumbs so we need to use permissions
So I have made you a series of pics which should tell the story ok.
It involves two top level Categories: one called Public Downloads and the other called LoggedOnDownloads
The Access Level for 'Public Downloads' is set at Public, for 'LoggedOnDownloads' it is set to Registered.

Note it is essential to set the Download permissions at the jD Component level -(accessed via Options button in jD Control Panel) to Inherited. When setting the permissions on the top Level Categories you must do a Save in order to propagate the permissions to sub-cats and Downloads.

If you do not want the 'staff' to see the 'Public' Downloads then set the Download permission for the Public UG back to Inherited and then then the Download permission in the Guest UG to Allowed - and after each change do a Save to propagate.

Please let me know if this is OK
Colin

Edit - I see also ref to topic http://www.jdownloads.com/forum/index.php?topic=8720 that Arno has answered.  This would help as you could then use the multiple menu scheme but it would need to await an update.
Colin

[gelöscht durch Administrator]
Colin M
  •  

elisa

Hi Colin,
thanks for taking so much time and do all the screenshots for me, but I'm quite familiar with ACL - the settings of the permissions are ok. I just don't want the categories to be mixed in one menu item.

Means I need another structure of the site and like written above I managed it now to have them both in separate menu items like that:

Joomla Menu

Customer Downloads
- category
- category
- category

Member Downloads
- category
- category
- category

But now when I navigate deeper into the downloads in the subcategories the breadcrumbs only show "home" like in the issue you linked: http://www.jdownloads.com/forum/index.php?topic=8720

Do you mean with awaiting an update that showing breadcrumbs is currently not possible without a menu item?

Thanks a lot and i really appreciate your help.
  •  

ColinM

Elisa,
Glad you are ok with ACL.

At present the only way I know to get both the breadcumbs and the categories 'separation' correct as needed is to use the 'list all cats' menu item.  Being able to use separate 'single' categories menu items would be advantageous.

The code for this is deeply embedded and goes back a long way historically - and was before my time with jD.  I think it was before having menu items for individual categories was available.  It is also the basis for making links.  So making a change would require very, very extensive testing. It is a desirable feature however so in the longer term I am sure it will be addressed. A distinct challenge is the multiple 'routes' in jD to get items listed: there is the normal navigation, the Overview link, All Downloads link, the Back button and so on. Treated individually they seem straightforwarde but the interaction can be 'interesting'.

I could be wrong but I suspect Arno may want to wait until a major version change. And such a new version is being actively worked on. But he might find a quicker solution.  So this enhancement might be put into 'Suggestions'.
Colin
Colin M
  •  

elisa

Hi Colin,
ok thank you for your time and for your help, looking forward to the new version and I hope that it will be easy to migrate ;)

See you,

Elisa
  •