WebsiteBaker Community Forum (upd)

WebsiteBaker Support (2.10.x) => General Help & Support => Topic started by: johnbroeckaert on January 05, 2018, 08:54:59 PM

Title: After login to a specific page?
Post by: johnbroeckaert on January 05, 2018, 08:54:59 PM
Hi,

On a site I want the visitor to be referred to another page after login. Is that possible?
wb2.10
php7.1.x

THANX
Title: Re: After login to a specific page?
Post by: crnogorac081 on January 05, 2018, 09:56:41 PM
there is a redrect in core files, but I didnt see the option in backend.. You would need to change the core.
Title: Re: After login to a specific page?
Post by: johnbroeckaert on January 05, 2018, 10:17:19 PM
@crnogorac081

Quotethere is a redrect in core files
I don't know what you mean by that. It is in the frontend that i want to send a user who logged in to an other page.
cheers
Title: Re: After login to a specific page?
Post by: Ruud on January 05, 2018, 11:00:49 PM
Normally the login page is shown when a user wants to access a page that has access set to registered.
Linking to that page will first show the login page and after a succesfull login it will redirect to the original linked page.

If you use a loginbox in a normal page you can add a hidden field (in the login form) that holds the url to be used after succesfull login.

The standard droplet to generate a loginform has this built in already.
Use:
[[LoginBox?redirect=url]]

So just put this droplet - with the redirect parameter - somewhere in your template or in a normal wysiwyg page.
Title: Re: After login to a specific page?
Post by: johnbroeckaert on January 06, 2018, 12:38:18 PM
Maybe I should explain the problem.
There are a number of user groups. Each user group must go to another OWN user group page after login.

As far as I can see I can't use the loginbox droplet because there is only room for a 'static' page there.

I'm now trying the template madoven, because there is already a login in the template, to get so far that it switches to another page after login.
Unfortunately I am not such a coder hence my question here. :|

john
Title: Re: After login to a specific page?
Post by: crnogorac081 on January 06, 2018, 12:51:15 PM
you must customize login droplet..

you must give us more info which group to go where..
Title: Re: After login to a specific page?
Post by: johnbroeckaert on January 06, 2018, 01:05:00 PM
Hi @crnogorac081,

There is a seperate page for every group. Group A has to go to page A. Group B has to go to page B. etc.
For each new group, there will be a new page with the name of that group.

Is this clear enough.

The login is only for members of a group. Other users stay on the public pages.
Title: Re: After login to a specific page?
Post by: Ruud on January 06, 2018, 01:47:12 PM
You cannot do that by using the redirect parameter. Before logged-in you don't know what group the user will be in.

I like the idea, so I made a small droplet to handle this for you.
It is published here: https://dev4me.com/droplets/other/go-to-grouppage-after-login/

Just set one or more of these lines in the top of the droplet:

$urllist[group_id] = WB_URL.'/pages/page-for-that group.php';

..or when using shorturl

$urllist[group_id] = WB_URL.'/page-for-that group/';

Title: Re: After login to a specific page?
Post by: johnbroeckaert on January 06, 2018, 01:56:27 PM
@ruud

(Y) (Y) (Y) (Y) (Y) (Y) (Y) (Y) (Y)
Nice work.... T H A N K S
Title: Re: After login to a specific page?
Post by: crnogorac081 on January 06, 2018, 02:11:47 PM
 (Y)