Page 1 of 2

Remove "Subcategories" tab from the user control panel.

Posted: 25 Apr 2023, 16:47
by dankup
Hi, is it possible to disable and remove the "Subcategories" from the "user control panel".

I am aware that in the "Categories View" Options tab the "Display Subcategories" can be set to "No".
And that in the "Users" Options tab the "Maximal Count Of Subcategories" can be set to "0".

But still de "Subcatgories" tab appears in the "user control panel" on the front end.
For my usage and users I would like to hide the "Subcategories" tab from the user control panel.

Thanks for your advice.

Re: Remove or hide "Subcategories" tab from the user control panel.

Posted: 26 Apr 2023, 09:09
by dankup
In fact the software should be able to just hide the "Subcategories" tab from the user control panel once the "Maximal Count Of Subcategories" is set to "0".
What do you think?

Re: Remove "Subcategories" tab from the user control panel.

Posted: 26 Apr 2023, 11:20
by christine
Hi,

More likely due to a template override.
Or try like this:
Code into your custom.css of your template:

Code: Select all

a.phTabsA.phTabsHeader#phTabId6448efa6a6ca4Itemsubcategories {
display: none;
}
Of course you will have a different #phTabId .... number than in the pattern above.
You can see this with inspector for inserting it in the code. Tried it temporarily on a test site and it works.

Kind regards
Christine

Re: Remove "Subcategories" tab from the user control panel.

Posted: 27 Apr 2023, 10:06
by dankup
Thanks for your tip, but this seams not to work.
I tried to put a custom.css in the "Cassiopeia" template and in the Phoca Galley "Styles" with the code you adviced, but still the "Subcategories" tab is available in the user control pannel.
I also noticed that the value of #phTabId is changing when starting a new session.

Kind Regards,
Daniel.

Re: Remove "Subcategories" tab from the user control panel.

Posted: 27 Apr 2023, 10:32
by christine
Hi Daniel,
dankup wrote: 27 Apr 2023, 10:06 I tried to put a custom.css in the "Cassiopeia" template and in the Phoca Galley ...
In principle for Cassiopeia you should use a user.css.
I also noticed that the value of #phTabId is changing when starting a new session.
The Code works, but you are right: Unfortunately the number of the #phTabld is changing.

Therefore I think we need a template override, as supposed in previous Post & have to find the correct file.

Kind regards
Christine

Re: Remove "Subcategories" tab from the user control panel.

Posted: 28 Apr 2023, 13:44
by dankup
Thanks for your reply. I am looking forward for what file has to be changed to hide the subcategories tab from the uiers control panel.
Thanks and kind regards,
Daniel.

Re: Remove "Subcategories" tab from the user control panel.

Posted: 28 Apr 2023, 15:14
by Jan
Hi, CSS is even able to select items by class and order of it. So e.g. if the tab is second, you can access this item without need to include ID (which is changing):

https://www.w3schools.com/cssref/sel_nth-child.php

The tabs feature is made by two items (the tab folder and content, so both need to be hidden). And if there is Javascript (depends on Bootstrap version), maybe there can be some conflicts, so in such case only template override can help :idea:

Jan

Re: Remove "Subcategories" tab from the user control panel.

Posted: 28 Apr 2023, 19:44
by christine
Hallo Jan,

could you please check, if following file/codes etc. could be correct?

Template override:

copy this file: /components/com_phocagallery/views/user/tmpl/default.php
to: /templates/your template/html/com_phocagallery/user/default.php

(You can also do this directly in backend under: Create overrides).

To delete or to comment it out:

line 79:

Code: Select all

$tabItems[2] = array('id' => 'subcategories', 'title' => Text::_('COM_PHOCAGALLERY_SUBCATEGORIES'), 'image' => 'subcategories', 'icon' => 'category');
lines 93-95:

Code: Select all

echo $tabs->startTab('subcategories');
echo $this->loadTemplate('subcategories');
echo $tabs→endTab();
thanks, Christine

Re: Remove "Subcategories" tab from the user control panel.

Posted: 28 Apr 2023, 20:11
by Jan
Hi, yes, this should do the trick.

Jan

Re: Remove "Subcategories" tab from the user control panel.

Posted: 29 Apr 2023, 10:27
by dankup
Hi Christine Jan,

Thanks for the workaround, it works !!!!

I wonder if this override will still be there and be applicable after a Joomla and/or Phoca Gallery upgrade.

In my view the best solution is to improve (change reauest) Phoca Gallery to hide the "Subcategories" tab from the user control panel once the "Maximal Count Of Subcategories" is set to "0".
What do you think?

Thanks for your support and quick responses.
Kind Regards,
Danny.