1

I'd like to tweak my language filter plugin a bit, and if possible, I'd like to do that as an override.

I know how to override some features in Joomla, but I'm not sure what to do in case of a system plugin.

  1. What folder do I copy in?
  2. Which one in my template's folder (if that's how it's done)?
  3. If there is a better way, please suggest.
  • Template overrides are for layout files. You can override a plugin's layout/template files, assuming the plugin is designed this way. But this cannot be used to change behavior of system plugins. Usually you have to write your own plugin to use that instead of the one you want to override. What type of changes you want to do on the language filter plugin? What is not working the way you want and what you are trying to achieve? – FFrewin Aug 31 '18 at 11:14
  • This makes sense. My problem is that it works on most of the site, but I have a catalog page that relies on request parameters to work properly. Like mysite.com/fr-ca/catalogue?sku=123 and the translated page would be mysite.com/en-ca/catalog?sku=123. The plugin rewrites the hreflang to the correct page, but doesn't append the url request parameters at the end, and I'd like it to. – louisv Sep 1 '18 at 0:33
0

Template overrides are for layout files. You can override a plugin's layout/template files, assuming the plugin is designed this way. But this cannot be used to change behavior of system plugins. Usually you have to write your own plugin to use that instead of the one you want to override.

In your case you could copy the Language Filter Plugin, rename it wherever it needs renaming and then adjust the code where you want it. Then when your plugin is ready, disable the core one and use yours in its place.

Note that you will have to maintain and update your plugin when needed in order to keep it compatible with newer Joomla versions.

Follow the resources here to find out more about Plugin Development: Documentation: Plugin Development

By the way: What type of changes you want to do on the language filter plugin? What is not working the way you want and what you are trying to achieve?

  • Thank you! I think I will do that. Though you are right to question what I want to do with it in the first place. And you can check my reply to the comment above, but basically, I'd like to append the request parameters at the end of the hreflang links, when there are some. – louisv Sep 1 '18 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.