joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.69k stars 3.63k forks source link

Can't override Accessibility plugin #37914

Closed biltongandpotroast closed 3 months ago

biltongandpotroast commented 2 years ago

Steps to reproduce the issue

I created a plugin overrride for plugins/system/accessibility by creating a copy of plugins/system/accessibility/accessibility.php to a new directory templates/rt_horizon/html/plg_system_accessibility and modified the icon code in there according to this advice: https://github.com/joomla/joomla-cms/issues/30277#issuecomment-668702327

Expected result

The accessibility plugin icon should change on the front end.

Actual result

There is no change.

System information (as much as possible)

Joomla 4.1.4 Browser Firefox 100.0.2 (64-bit)

Additional comments

I then made the same change to the core file plugins/system/accessibility/accessibility.php and got the expected result I wanted.

I'm assuming that this plugin is not overridable according to this Joomla documentation explanation https://docs.joomla.org/J3.x:Layout_Overrides_in_Joomla#Plugin_AlternativeLayouts.28Overriding_a_Plugin.29

I would prefer a new feature to allow you to customise the plugin output with plugin parameters. If this can't be done can you at least allow this plugin to be overriden?

chmst commented 2 years ago

Thank you for reporting, as it shows your interest in accessibility. This plugin will be improved and styled and expanded in the GSoC 2022 project "ascessibility plugin". Then you can besure that the corrct icon will be used. But at the moment, the developers will not invest time for changes in plugin as it is now.

biltongandpotroast commented 2 years ago

Fair enough, thanks chmst.

For anyone else wanting to change the icon as I have done, update core file plugins/system/accessibility/accessibility.php

At line 92 change:

'icon' => [....],

to:

                'icon' => [
                    'position' => [
                        $direction => [
                            'size' => '0',
                            'units' => 'px',
                        ],
                        'bottom' => [
                            'size' => '5',
                            'units' => 'px',
                        ],
                        'left' => [
                            'size' => '5',
                            'units' => 'px',
                        ],
                    ],
                    'useEmojis' => false,
                    'img' => 'accessibility_new',
                    'circular' => true,         
                ],

and to remove the border shadow, add this to your custom CSS file: i.circular._access-icon {border:none;}

h-tagliato commented 1 year ago

Thank you for your suggestion, therefore the option 'useEmojis' => false remove the icons from the next panel (those before label "increaseText" etc.), while setting 'useEmojis' => true the icons appear again but the wheel-chair icon returns on the front end. (Joomla 4.1.4).

Do you have any other suggestion? Thank you anyway


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37914.

biltongandpotroast commented 1 year ago

Thank you for your suggestion, therefore the option 'useEmojis' => false remove the icons from the next panel (those before label "increaseText" etc.), while setting 'useEmojis' => true the icons appear again but the wheel-chair icon returns on the front end. (Joomla 4.1.4).

Do you have any other suggestion? Thank you anyway This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37914.

I had the same issue, the icons are not displayed because the 'Material Icons' Google font file is not being loaded because of a bug in /media/vendor/accessibility/js files, which use 'Material+Icons' instead of 'Material Icons'.

I tried a temp fix according to Brian Teeman's advice here and here (very tedious discussion) by changing the accessibility.min.js file but it did not work (because I think the JS is loaded from accessibility.min.js.gz which I did not change) so ended up applying this temp CSS fix in custom.css.

A permanent fix has been done by Brian Teeman in the Joomla core and will be released in Joomla 4.2. The fix will provide a new plugin parameter to choose either Emojis (look crap) or Google Material Font (much nicer) so you must ensure Google Material font is selected when you install this. You will probably also have to restore my previous core change after installating J4.2.

biltongandpotroast commented 1 year ago

So now with Joomla 4.2.1 the accessibility plugin (System - Additional Accessibility Features) has been enhanced to allow you to choose between Google Material Font or Emojis.

  1. Select Google Material Font in the plugin settings.
  2. To change the icon from wheelchair to person, you will still need to add the line 'img' => 'accessibility_new', after line 'useEmojis' => $this->params->get('useEmojis') != 'false' ? true : false,
  3. To make the icon circular and reposition it tighter to bottom left corner of page, add the following CSS to your custom.css file: i._access-icon {bottom: 5px !important; left: 5px !important; border-radius:50%;}

When you update Joomla in future, do Step 2. again to reinstate the change which the update will overwrite.

Hopefully in future someone will add the ability to change the icon in the plugin parameters instead of doing this core hack.

Quy commented 3 months ago

Related #43143

brianteeman commented 3 months ago

This will be addressed in the new version

Quy commented 3 months ago

Thanks Brian!