Support

Pre-sales

#37000 How to load Akeeba Social Login (Link Button) into another component

Posted in ‘Pre-sales and Account Questions’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by nicholas on Friday, 22 April 2022 07:49 CDT

dayyal

Hello,

Fisrt of all thank you for making this amazing plugin, and many more thanks for making this extention freely available for all the users. Dear developers, I am creating a new membership based website on Joomla 4 and I am using OS Membership Pro for membership management. When a user logged in to the website, the user is redirectred to their OS Membership Profile Page (NOT THE DEFAULT JOOMLA USER PROFILE PAGE). Now I want to let the logged-in users to link/unlink their social connection from their OS Membership Profile Page. I had tried the below code to render the Social Link/Unlink button but it is not working.

<?php

if (class_exists('Akeeba\\SocialLogin\\Library\\Helper\\Integrations')) echo \Akeeba\SocialLogin\Library\Helper\Integrations::getSocialLoginButtons();

?>

nicholas
Akeeba Staff
Manager

I will assume that you are talking about SocialLogin 4 for Joomla 4.

We no longer have a bespoke integration for login buttons because we no longer need it. SocialLogin 4 uses Joomla 4's built-in additional login buttons feature. All of the sociallogin plugins respond (through the system plugins) to Joomla's onUserLoginButtons event. This means that any Joomla 4-compatible login module or component will display them.

However, you do not want the login buttons, you want the link/unlink buttons. For these, there is still an integration: \Joomla\Plugin\System\SocialLogin\Library\Helper\Integration::getSocialLinkButtons()

So what you need to do is:

if (class_exists(\Joomla\Plugin\System\SocialLogin\Library\Helper\Integration::class)) {
  echo \Joomla\Plugin\System\SocialLogin\Library\Helper\Integration::getSocialLinkButtons();
}

The namespace is different because Joomla 4 uses namespaced plugins which need to follow the convention \Joomla\Plugin\FOLDER_NAME\PLUGIN_NAME as their root namespace (this assumption is hardcoded in several places and something we had discussed in the Joomla 4 Working Group a lot back in 2015 when we were deciding how to best implement namespaced extensions for Joomla).

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

dayyal

Thank you so much Nicholas for updating here, and as well as on GitHub too. I had tried this, and now it is rendering the Link/Unlink button properly. Many more thanks for developing this useful extention.

nicholas
Akeeba Staff
Manager

You're welcome and thank you for your kind words! Have a great day :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!