Remove "Subcategories" tab from the user control panel.

Phoca Gallery - image gallery extension
dankup
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 25 Apr 2023, 16:32

Remove "Subcategories" tab from the user control panel.

Post 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.

Tags:
dankup
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 25 Apr 2023, 16:32

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

Post 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?
christine
Phoca Hero
Phoca Hero
Posts: 2818
Joined: 28 Nov 2010, 17:20

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

Post 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
dankup
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 25 Apr 2023, 16:32

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

Post 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.
christine
Phoca Hero
Phoca Hero
Posts: 2818
Joined: 28 Nov 2010, 17:20

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

Post 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
dankup
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 25 Apr 2023, 16:32

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

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

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

Post 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
If you find Phoca extensions useful, please support the project
christine
Phoca Hero
Phoca Hero
Posts: 2818
Joined: 28 Nov 2010, 17:20

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

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

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

Post by Jan »

Hi, yes, this should do the trick.

Jan
If you find Phoca extensions useful, please support the project
dankup
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 25 Apr 2023, 16:32

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

Post 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.
Post Reply