Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Forms & Blueprints

How to customize the login form with css, outerclasses and classes

Solved by julien View solution

Started by Pedro M 6 years ago · 3 replies · 1700 views
6 years ago

Hi,

How can I customize the login form template with custom css and outerclasses and classes in md files?

Now I have my login form like this:

login-form|668x500

I want to center all elements, but I've couldn't still. I've changed the login.css and I've tried to set some outerclasses and classes (col-md-6 and col-md-12 and classes: form-control input-lg) in login.md, but I have not got what I want.

In login.css I've modified the text-align property and work for labels, but not for input boxes

CSS
#grav-login {
    max-width: 70rem;
    margin: 5rem auto;
    background: #fcfcfc;
    border: 4px solid #eee;
    border-radius: 4px;
    padding: 1rem 3rem 3rem 3rem;
    text-align: center;
}

Have you got any idea about how I can to customize this login form?

Thanks very much.

👍 1
6 years ago Solution

Hi @pmoreno,
I'm not sure if you are still searching for an answer.
But one of great way templates files are managed by Grav is that you can override plugin html.twig files easily.
If you copy /plugins/login/templates/partials/login-form.html.twig and paste it in your theme folder.
From there, you can set the html markup you wish. Just make sure you don't delete any twig snippet or you might break things.

6 years ago

Hi @julien,

Finally, I've solved this issue with your method. I've copied the login templates and css to my custom theme folder, and there I can change all I need.

Thanks for your help.

6 years ago

👍 Well done!
I'm glad I could help.

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1139 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 63 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 137 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 112 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 131 7 months ago