Topic-icon Assigning a template (or just forcing an itemid) to the login/register

Active Subscriptions:

None
Hi again,
On my site I'm using two templates, a default one for most of the site's articles and another one for the social part of it (based on EasySocial). I need to somehow make that additional template load for the login/register page of JFBC (or for JFBC to inherit the itemid from EasySocial). Tried adding a menu item but there's no option for creating one for the login page. Any advice?
Thanks,
wdd
The topic has been locked.
Support Specialist
In the /components/com_jfbconnect/controllers/login.php file, around line 110, you'll see:
$app->redirect(JRoute::_('index.php?option=com_jfbconnect&view=loginregister&provider=' . strtolower($provider->name) . '&return=' . base64_encode($return), false));
You'll have to add your Itemid to that URL, like:
$app->redirect(JRoute::_('index.php?option=com_jfbconnect&view=loginregister&provider=' . strtolower($provider->name) . '&return=' . base64_encode($return) . '&Itemid=xyz', false));
There's no other way to force that other than the code change.

I hope that helps, but if you need anything else, just let me know.

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

None
Hi,
Thanks for this. This is a core file, I'd like to avoid hacking it. Is there any code I could add to a file that I can override from the template?
Thanks,
wdd
The topic has been locked.
Support Specialist
JFBConnect uses whatever your default template is. We don't have any mechanism to do what you're asking. A template override would not be appropriate in this case. A core file edit is the only option that we see for what you want to do.

-Melissa
The topic has been locked.
Active Subscriptions:

None
Hi, thanks. What if I'm using EasySocial for the registration? I get redirected to /component/easysocial/registration even though I have a menu item leading to the registration page so it should go to /register and feature the itemid so I could control which template to load. Past the profile type selection page I get the correct template loading as it's picking that itemid up from the menu item I set up. I know I could simply replace $plugin->registration_url with the URL but is there a more elegant way of dealing with this?
Thanks,
wdd
The topic has been locked.
Support Specialist
Actually, try updating the socialprofiles/easysocial/easysocial.php file by changing:
$this->registration_url = 'index.php?option=com_easysocial&view=registration';
to:
include_once(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php');
$this->registration_url = FRoute::registration();
That's the code we use in the SCLogin module to redirect to the EasySocial registration URL in a pretty format, but looks like we didn't do it in the socialprofile plugin.

Test that and let us know if it does what you're looking for. If so, we'll make sure it's included in the next release.

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

None
11 years 3 months ago - 11 years 3 months ago #51275 by wdd
Hi Alex, yes that's exactly what I needed. Very glad I can install future updates without losing the changes and not have to hack code anymore.
Thanks a million,
wdd
Last edit: 11 years 3 months ago by wdd.
The topic has been locked.
Support Specialist
I checked in the change, so it should be available for our next release.
The topic has been locked.
Active Subscriptions:

None
Cool, thanks Melissa.
Cheers,
wdd
The topic has been locked.