2

I think I might found a bug(?)

Only administrators can create content on my site, so I am trying to remove the login form from the front page, its okay that the login page can be accessed at site/user/login, but not on the front page, I have tried quite a few things.

I have followed the guide in https://www.drupal.org/node/13777

Im using the bartik theme, I have sub-themed it, but I have barely changed anything in it, basically just a little css.

And I have tried the following:

  1. admin/structure/block and hide the user login block.
  2. admin/structure/block and completely removed the block.
  3. admin/structure/block and moved it to a specific location and then hiding it based on page.
  4. admin/structure/block and moved it to a specific location and then hiding it based on role.
  5. admin/config/people/accounts and disabled register/login for anonymous users, which I guess works as they can't register, but the login form is still on the front page.
  6. Hide the block with CSS, which works, but then I can't ever login before I change the CSS back.

Adding some images + github link: Github link: https://github.com/DenLilleMand/christianssite Imageone(frontpage): enter image description here

Imagetwo(structureblock): enter image description here

Imagethree: enter image description here

  • I cannot reproduce this issue with a standard install on simplytest.me. The user login block does not appear by default on the home page when logged out. There is a "login" menu link, which can be removed by disabling it from the Menu, but there is no user login block. Edit: I also placed the user login block, confirmed that it appeared, and then moved it to Region None, and it correctly did not display when logged out. We are going to need to see some code or know more about your site that is different from the Standard Drupal 8.0.1 install. – mradcliffe Dec 18 '15 at 13:53
  • I have added a github link, i have subthemed bartik, and i have one custom module enabled which is the flex_slider – DenLilleMand Dec 18 '15 at 14:13
  • Ive just installed a new site, the site i was building was following a book tutorial, so i guess that ive done something at some point that unleashed this weird thing that outputs the login block no matter what. I can't quite find anything related to a user login block though. – DenLilleMand Dec 18 '15 at 15:18
  • I don't see anything that could have caused this in the theme code. – mradcliffe Dec 21 '15 at 14:53
  • I fixed it by just createing a new site and moving the module over. It was a site i made during a tutorial, so i must've added something weird somewhere and forgotten about it. Nevertheless, i cannot reproduce it, so it mustve been me i guess :) ... i couldn't find anything related to it either, so im still a bit stumbled, thanks for looking it over though :) – DenLilleMand Dec 21 '15 at 14:59
1

I had a similar problem.

As described in the issue, we had the same problem in Drupal 7 with the "No front page content has been created yet" message. In Drupal 8, if you have no content on the page the default is to display the user page. If the user is not logged in, it defaults to the login page.

The best solution to this is to have content on the front page. However, assuming you want a blank front page except for some custom blocks, you can remove the Login Form by either creating or editing the existing page--front.html.twig file in your theme.

Since you don't have any content on the front page, you can remove the "Content" region and then remove the "Header" region to remove the tabs.

EDIT: I just found that if you do remove the "Content" region from the page--front.html.twig file, this will also remove it from the login page, which is a problem. Not sure why this is. Still working on a solution.

Finally, make sure that you leave the "Front Page" setting blank = 'Manage > Configuration > System > Front Page'

These are the two blocks I removed from my theme

   {# Content #}
    {% block content %}
      <a id="main-content"></a>
      {{ page.content }}
    {% endblock %}

  {# Header #}
  {% if page.header %}
    {% block header %}
      <div class="col-sm-12" role="heading">
        {{ page.header }}
      </div>
    {% endblock %}
  {% endif %}
  • I dont have time to check the validity on this, but you seem to know what youre talking about :) And its a much better solution than just reinstalling drupal :D So i will accept this answer for now. – DenLilleMand Oct 7 '16 at 9:11
  • Thanks for confidence. My explanation of where the problem comes from should be correct, but I found a problem with my solution. Removing "content" from front page, also removes it from the LOGIN page. At this point, on my project, I just created a special "page" for the front page and listed it here = 'Manage > Configuration > System > Front Page' – stpaultim Oct 9 '16 at 22:27
0

If you've done all of those block things and it's still showing then we can be pretty sure it's not that login block that is coming out on the site.

Hard to help without seeing the code.

You might be getting the access denied page for your homepage, worth a look

  • Where do i look for this? my flex slider is showing which is my custom module, so that modules permissions should be okay?, and there is no permissions on the theme. – DenLilleMand Dec 18 '15 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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