Remove Create New Account button

Remove Create New Account button

by Mia Musolino -
Number of replies: 8

Using Boost with Moodle 3.6.3. Can I remove the Create New Account button from the login page with Custom CSS? I do NOT want to disable email based self-registration -- I just want to distribute the new account URL form separately from the login page. 

Average of ratings: -
In reply to Mia Musolino

Re: Remove Create New Account button

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Mia,

Have you tried using the browser development tools (F12 key) to look help work out what it could possibly be? They are a really useful debugging and development tool.

G
In reply to Gareth J Barnard

Re: Remove Create New Account button

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

P.S. Actually does not look like it, but if you remove:

{{#hasinstructions}}
<div class="row justify-content-center mt-3">
<div class="col-xl-6 col-sm-8">
<div class="card">
    <div class="card-body">
        <div class="card-title">
            <h2>{{#str}}firsttime{{/str}}</h2>
        </div>
        <div>
        {{{instructions}}}
        {{#cansignup}}
            <form class="mt-3" action="{{signupurl}}" method="get" id="signup">
                <button type="submit" class="btn btn-secondary">{{#str}}startsignup{{/str}}</button>
            </form>
        {{/cansignup}}
        </div>
    </div>
</div>
</div>
</div>
{{/hasinstructions}}

from 'theme/boost/templates/core/loginform.mustache' (make a backup of the file first) and then do a 'Purge all caches' then that should do the trick.

In reply to Gareth J Barnard

Re: Remove Create New Account button

by Mia Musolino -
Thanks Gareth... yes! I am pretty good with the inspect tool and identifying the CSS that needs changing that way, but all I was able to achieve was removing ALL secondary buttons! So... I guess I still have much to learn!
In reply to Mia Musolino

Re: Remove Create New Account button

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers

You can remove the "Create new account" button with CSS, but not the instructions above it (without changing code as Gareth has suggested).

Go to Site Administration > Appearance > Themes > Boost and then click on Advanced Settings and enter the following into the "Raw SCSS" box...

#page-login-index form#signup {display: none;}

You could then maybe just change the instructions in the language pack to say that you be sending the details separately (see https://docs.moodle.org/37/en/Language_customisation#Changing_words_or_phrases).

In reply to Jon Bolton

Re: Remove Create New Account button

by Mia Musolino -
Jon - I used your solution -- thanks so much.

Central to my inability to solve these things on my own using CSS is that I guess I am not specifying WHERE to make the change. Another example that I have not been able to solve is the card title on the login page "Is this your first time here?"... I would like that to go away, but only the card title on the login page -- not all card titles, of course! So how would I achieve that?

I am asking this in the spirit of someone who really is on the verge of getting this CSS customization thing... just a few more bits to get into place!
In reply to Mia Musolino

Re: Remove Create New Account button

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers

You can either edit the language pack and replace that string with a space or something, or hide it with CSS.

The problem is that that particular string is an h2 tag but not specific to that bit of the page. So if you hide it, you hide all h2 tags on that page. On the login page that should be ok, but be careful smile

Try...

#page-login-index h2 {display:none;}