<p>You'd have to write a <a href="https://craftcms.com/docs/plugins" rel="nofollow">custom plugin</a>, that adds an <a href="https://craftcms.com/docs/plugins/hooks-and-events#events" rel="nofollow">event listener</a> for the <a href="https://craftcms.com/docs/plugins/events-reference#entries-onSaveEntry" rel="nofollow"><code>entries.saveEntry</code></a> event.</p>

<p>The event listener should go into your plugin's primary class' <code>init</code> method. You'll need to make sure the event listener only fires for Control Panel requests, and that the currently logged in user is assigned to the user group you want to apply this to.</p>

<p>You should also make sure the entry being saved has a URL (not all entry types do) before attempting to redirect.</p>

<p>Here's a working example:</p>

<pre><code>public function init()
{

    parent::init();

    // Get the currently logged in user
    $user = craft()-&gt;userSession-&gt;getUser();

    // Only add the event listener for Control Panel requests, and if the user is in a certain group
    if (craft()-&gt;request-&gt;isCpRequest() &amp;&amp; $user &amp;&amp; $user-&gt;isInGroup('userGroupHandle')) {

        craft()-&gt;on('entries.saveEntry', function (Event $event) {

            // Redirect to the entry
            $entry = $event-&gt;params['entry'];
            if ($entry-&gt;url) {
                craft()-&gt;request-&gt;redirect($entry-&gt;url);
            }

        });

    }

}
</code></pre>

<p>Obviously, you'll need to change the <code>userGroupHandle</code> string to the handle for your particular user group.</p>

<p>If you're unfamiliar with plugin development for Craft, I'd recommend taking a look at the <a href="https://github.com/lindseydiloreto/craft-businesslogic" rel="nofollow">Business Logic</a> template plugin or the <a href="http://pluginfactory.io/" rel="nofollow">pluginfactory.io</a> generator app – as well as the <a href="https://craftcms.com/docs/plugins" rel="nofollow">official docs</a> on the subject, of course.</p>

CC BY-SA 3.0
2016-01-20T09:51:38.693Z
Awesome, thanks @Mats Mikkel Rummelhoff, works like a bomb! :)
Nicole Lambon
CC BY-SA 3.0
2016-01-20T09:24:08.333Z
2016-01-20T09:41:11.243Z
2016-01-20T09:41:11.243Z
Mats Mikkel Rummelhoff
<p>Is it possible to redirect a certain user type to the entry front-end page once they click on Save from the CP?</p>

<entries><control-panel><redirect><craft-pro>
On Entry Creation Redirect
# On Entry Creation Redirect

(Asked by: username_0 on 2016-01-20)

Is it possible to redirect a certain user type to the entry front-end page once they click on Save from the CP?

**Tags:** entries, control-panel, redirect, craft-pro

---

## 1 answers

### Answer by username_1 on 2016-01-20. Score: 4 | Accepted answer

You'd have to write a custom plugin, that adds an event listener for the entries.saveEntry event.
The event listener should go into your plugin's primary class' init method. You'll need to make sure the event listener only fires for Control Panel requests, and that the currently logged in user is assigned to the user group you want to apply this to.
You should also make sure the entry being saved has a URL (not all entry types do) before attempting to redirect.
Here's a working example:
public function init()
{

    parent::init();

    // Get the currently logged in user
    $user = craft()->userSession->getUser();

    // Only add the event listener for Control Panel requests, and if the user is in a certain group
    if (craft()->request->isCpRequest() && $user && $user->isInGroup('userGroupHandle')) {

        craft()->on('entries.saveEntry', function (Event $event) {

            // Redirect to the entry
            $entry = $event->params['entry'];
            if ($entry->url) {
                craft()->request->redirect($entry->url);
            }

        });

    }

}

Obviously, you'll need to change the userGroupHandle string to the handle for your particular user group.
If you're unfamiliar with plugin development for Craft, I'd recommend taking a look at the Business Logic template plugin or the pluginfactory.io generator app – as well as the official docs on the subject, of course.

> **Comments:**
> **username_0**: Awesome, thanks @Mats Mikkel Rummelhoff, works like a bomb! :)  

---

