Topic-icon Can I add JFBConnect login to default joomla login

Active Subscriptions:

None
I have been using JFBConnect successfully for some time, and have the 'login with Facebook' link added to the log-in page that is linked to from the main menu on my joomla site (jooma 1.7). However, access one resource on my website is restricted to registered users, and if the link to this restricted resource is followed then joomla brings up the default login page which only includes joomla login. Does anyone know what code I need to edit to add 'Login with Facebook link' to the default login page that is shown when trying to access restricted content (when not already logged in)? I don't seem to be able to find a module that is controlling the log-in screen that is brought up automatically when attempting to access restricted content? Any advice would be greatly appreciated.
The topic has been locked.
Support Specialist
14 years 3 months ago #19019 by alzander
Justin,
The template for the login page for Joomla can be found at /components/com_users/view/login/tmpl/default_login.php. We'd recommend copying that file to /templates/<YOUR_TEMPLATE>/html/com_users/login/default_login.php (creating those directories if required). This creates a template override which means that your changes won't be overwritten as you upgrade Joomla.

Once copied, you can edit that file and simply add {JFBCLogin} wherever you want the Login With Facebook button to appear.

Hope that's all you need, but if you need more help, let me know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 3 months ago #19039 by jussmi
Hi Alex, this one has got me stumped somewhat! I have tried to add the {JFBCLogin} tag to various locations within the file you highlighted, but I'm not getting the "Login with Facebook" button to appear. Is there some where specific it should be added (php below)? Was trying to get it to appear below the joomla "Log in" button. Any further suggestions would be welcomed. Thanks, Justin

<?php
/**
* @version $Id: default_login.php 22060 2011-09-12 14:14:55Z infograf768 $
* @package Joomla.Site
* @subpackage com_users
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @since 1.5
*/

defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
?>
<div class="login<?php echo $this->pageclass_sfx?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>

<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
<div class="login-description">
<?php endif ; ?>

<?php if($this->params->get('logindescription_show') == 1) : ?>
<?php echo $this->params->get('login_description'); ?>
<?php endif; ?>

<?php if (($this->params->get('login_image')!='')) :?>
<img src="<?php echo $this->escape($this->params->get('login_image')); ?>" class="login-image" alt="<?php echo JTEXT::_('COM_USER_LOGIN_IMAGE_ALT')?>"/>
<?php endif; ?>

<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
</div>
<?php endif ; ?>

<form action="<?php echo JRoute::_('index.php?option=com_users&task=user.login'); ?>" method="post">

<fieldset>
<?php foreach ($this->form->getFieldset('credentials') as $field): ?>
<?php if (!$field->hidden): ?>
<div class="login-fields"><?php echo $field->label; ?>
<?php echo $field->input; ?></div>
<?php endif; ?>
<?php endforeach; ?>
<button type="submit" class="button"><?php echo JText::_('JLOGIN'); ?></button>
<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('login_redirect_url',$this->form->getValue('return'))); ?>" />
<?php echo JHtml::_('form.token'); ?>
</fieldset>
</form>
</div>
<div>
<ul>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=reset'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_RESET'); ?></a>
</li>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=remind'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REMIND'); ?></a>
</li>
<?php
$usersConfig = JComponentHelper::getParams('com_users');
if ($usersConfig->get('allowUserRegistration')) : ?>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=registration'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REGISTER'); ?></a>
</li>
<?php endif; ?>
</ul>
</div>
The topic has been locked.
Support Specialist
14 years 3 months ago #19052 by alzander
Try the code below. I left the lines above where it should go to help you find the right spot. Once added, clean your Joomla cache. Then, on the page, see if the button is there. If not, check if the "TEST TEST" is there. That will help us narrow down if we're simply editing the wrong file or if the replacement of the {JFBCLogin} button simply isn't working.
See below

Thanks, and good luck,
Alex
The topic has been locked.
Support Specialist
14 years 3 months ago #19054 by alzander
Well, that chomped some code out.. Let's try again:
<?php echo JHtml::_('form.token'); ?> 
TEST TEST {JFBCLogin} TEST TEST
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 3 months ago #19058 by jussmi
Interestingly, nothing is appearing on the login page.... neither the "TEST TEST" or the facebook login button. I did clear both the joomla cache and browser cache when testing. Would seem that we're not editing the correct bit of code (or file), rather than a failure of the {JFBCLogin} tag.
The topic has been locked.
Active Subscriptions:

None
14 years 3 months ago #19063 by jussmi
Alex, I have solved the problem. Your solution works just fine. Why it wasn't working is that I use a Yootheme template, which points to a duplicate default_login.php stored under the Yootheme template folder! Alas, once I discovered this and edited the active version of the default_login.php it worked! Many thanks for all you help. p.s. I need to renew my subscription.... can I do this before it runs out in about 5 days, or do I have to wait until it expires then renew?
The topic has been locked.
Support Specialist
14 years 3 months ago #19064 by alzander
Justin,
Glad to hear you got that going. I mentioned the template overrides as a thing to do above, but neglected to mention that one may already be in place! Woops. Hopefully it's all smooth sailing from here.

As for renewing, we actually encourage resubscribing while you're subscription is still active. If you do so, you get 10% off the 6 month or 1 year price. Once your subscription expires, you'll have to pay the full subscription price. To get the discount, just be logged in when you choose your package and the 10% will automatically taken off when you go to the checkout page. When you renew, you will have 2 active subscriptions for a few days. It's a bug we're trying to fix, but nothing to worry about.

Finally, if you haven't already, please consider leaving a rating and review for JFBConnect on the Joomla Extension Directory. It's certainly not required, but very appreciated:
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks, and best of luck to you and your site,
Alex
The topic has been locked.