Topic-icon Assign template to JFBConnect Registration page

Active Subscriptions:

None
Hi,

is it possible to assign a template to the JFBConnect registration page? Usually I would create a Menu Item, but it seems to be, that it is not possible to create a menu item for the registration page...

Best Regards Michael
The topic has been locked.
Active Subscriptions:

None
And one additional question: How can I prevent JFBConnect from adding this tags to the html tag:
xmlns:og="ogp.me/ns#" xmlns:fb="ogp.me/ns/fb#"

This makes the site fail in the HTML validator - as far as I know this is not a requirement for the facebook login, or am I wrong?

Best Regards Michael
The topic has been locked.
Support Specialist
10 years 5 months ago #38613 by alzander
Michael,
You want a different Joomla template for the Login/Register page? Just want to clarify that you don't want a different layout for that view, but a whole separate template to customize? That's not a question we've had before, but I can look into how to best do that for you.

And one additional question: How can I prevent JFBConnect from adding this tags to the html tag:
xmlns:og="ogp.me/ns#" xmlns:fb="ogp.me/ns/fb#"

Those tags aren't required for Facebook Login, but are used for Open Graph integration. If you're relying on the Open Graph features of JFBConnect to set your tags for when your pages are shared in Facebook, those namespaces are required. They're also *recommended* by Facebook for the social buttons (Like, comment, etc).

I hope that helps. If you want those namespaces gone, we can help point you to the code to edit.

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

None
Hi,

yes I want a different Joomla template not a different view layout ;-)

Thank you for clarifying this! It would be nice if you could still point out where I could remove those namespaces.

Best Regards Michael
The topic has been locked.
Support Specialist
10 years 5 months ago #38718 by alzander
The namespaces are in the /components/com_jfbconnect/libraries/provider/facebook.php file. Around line 391, you'll see:
$body = str_ireplace("<html ", '<html ' . $ogNamespaces, $body);
Simply comment that line out, like:
//         $body = str_ireplace("<html ", '<html ' . $ogNamespaces, $body);
That should remove the ones we're adding.

For setting the template, you'll need to add a block of code to the /components/com_jfbconnect/views/loginregister/views.html.php file. In there, ate the top, you'll see the below around line 14:
{
    function display($tpl = null)
    {
        $app = JFactory::getApplication();
        $input = JFactory::getApplication()->input;

Update that by adding the following block:
{
    function display($tpl = null)
    {
// Add this code starting here
        $app = JFactory::getApplication();
        $db = JFactory::getDbo();
        $query = $db->getQuery(true);
        $query->select('id, template, params');
        $query->from('#__template_styles');
        $query->where('id = 3'); // UPDATE THIS LINE WITH YOUR TEMPLATE ID
        $db->setQuery($query);
        $template = $db->loadObject();
        if ($template)
        {
            $styles = new JRegistry();
            $styles->loadString($template->params);
            $app->setTemplate($template->template, $styles);
        }

// Below here is the original code
        $app = JFactory::getApplication();
        $input = JFactory::getApplication()->input;
Basically, you're adding that block in between the two // sections. The only thing to modify is the line noted to add your specific Template Style ID. Please add and test to make sure things go how you want.

Finally, if there's something we're not doing in our login/register file that you think we should be, or you have any general recommendations for improvements to simplify or clarify things for end users, we'd love to hear them. We're always looking for ways to improve things.

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

None
Hi,

thank you for your response! The Open Graph namespaces are gone, but the template setting did not work...

When I enter my ID my template is found, but this code:

$styles = new JRegistry();
$styles->loadString($template->params);
$app->setTemplate($template->template, $styles);

Does not change the template to the desired one... Do I need to change anything else in the template settings?

Best Regards Michael
The topic has been locked.
Support Specialist
10 years 5 months ago #38792 by alzander
Hmmm.. Not sure why that wouldn't work. We tested that exact code on our dev site, and it worked without issue. However, we're using the standard beez_20 template. If you're using a template that has a full framework with it, it's possible that's not allowing another template to be set.

Can you try (temporarily) setting your *default* template to something simple, like atomic or beez_20 and then test your code above. That will narrow down what is happening.. whether it's the 'new' template not being loaded or the live template not allowing itself to be overridden.

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

None
Hi,

it also doesnt work with beez as default template...

Best Regards Michael
The topic has been locked.