Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are several ways to go about this. The most straight-forward is to have a login link somewhere in the navigation that appends the destination to the url. The code for this is something like:</p> <pre><code>&lt;?php if (user_is_anonymous()) { $link = l(t('Login'), 'user/login', array('query' =&gt; drupal_get_destination())); } ?&gt; </code></pre> <p>You can also set a custom access denied page at admin/settings/error-reporting that could either go to a callback that outputs the above code, or to a simple php node that outputs that code.</p> <p>Additionally, the user login block provided with Drupal core uses the same method to redirect a successful login back to the originating page.</p> <p><strong>Edit</strong>: Note that the above methods will rarely work for registration, because there are more steps involved there. Specifically, when a user needs to verify an email address, passing the originating destination along via the email would involve modifying the core user registration process.</p> <p>It will potentially still work on a site configured to not verify email addresses. The idea then would be to provide 2 links: 1 for login and the other for registration, both passing along destination information.</p> <p><a href="http://drupal.org/project/logintoboggan" rel="nofollow noreferrer">LoginToboggan</a> may also be worth pursuing, although it doesn't yet offer the exact registration <a href="http://drupal.org/node/82320" rel="nofollow noreferrer">feature you're looking for</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload