-3

I am using the Drupal UI to make changes to a site, and I want to update the page that a user sees when they are not logged in. Is that a view I need to create?

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Jan 9 at 16:33

1 Answer 1

0

If the purpose is allowing visitors to log in from any page they could visit, it is sufficient to show the login block on every page.

There is no need to create a view for that. It is sufficient to visit /admin/structure/block, choose in which region the login block should be shown, and click on the Place block button for that region. In my case, I will place it on the Sidebar region.

screenshot

After I clicked on that button, I look for User login on the list of blocks, and click on the Place block button to its right.

screenshot

Then, on the dialog box that appears, I click on Save block.

screenshot

Anonymous users will now see the login block on any page they visit; logged-in users will not see the login block.

screenshot

screenshot

4
  • This is very helpful, thank you!! I need to add content where it says , you are not authorized to access this page. Is that another block? I am just learning drupal, I appreciate your help so much! Jan 9 at 19:52
  • That is the 403 error page content.
    – apaderno
    Jan 9 at 20:05
  • can I access that page from the Drupal UI, or do I need to code to access that page content? Jan 9 at 22:12
  • It cannot be edited from the UI. It is what \Drupal\system\Controller\Http4xxController:on403() renders.
    – apaderno
    Jan 10 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.