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.

Plugins

Where do I insert messages block from the login plugin?

Solved by Karmalakas View solution

Started by Phil White 11 months ago · 10 replies · 75 views
11 months ago

I'm following the instructions from GitHub about using the Login plugin. The first thing it says is...

"There is not a guaranteed way to display system messages including those added by the Login plugin, so in order to see messages you will need to make sure your theme has a method to output the messages. This is done by adding a simple Twig include, and the best place to do this to ensure it's visible in all your pages, is to add it to the partials/base.html.twig (or whatever your base Twig template is called):
{% block messages %}
{% include 'partials/messages.html.twig' ignore missing %}
{% endblock %}
A good location is probably to add this right above where your content is going to be output."

Can someone tell me the best place to insert the above simple Twig include into the partials/base.html.twig file? Is it necessary that I insert it at all? I have no idea what it is for or what it does.

11 months ago

@phil:
Can someone tell me the best place to insert the above simple Twig include into the partials/base.html.twig file?

It's literally in your quote:

@phil:
A good location is probably to add this right above where your content is going to be output.

11 months ago

The base.html.twig file contains code I do not understand. I have no idea where, in the code, content is going to be output.

11 months ago

Your quote also says it depends on the theme you use. Without you telling us that, there's not much to suggest, other than - search for content in your base template

11 months ago

I'm using a copy of the learn4 theme. Is it ok for me to post the content of the file here so someone can tell me where to insert the Login code? There are three instances of the word content. But if I insert some code, I don't know if it is ok to be inside a div or not.

last edited 07/10/25 by Phil White
11 months ago

OK. Thank you. So it's already in there, and there isn't anything else I need to do, right? I didn't see that.

11 months ago

Another question regarding the Login plugin. The next thing in the GitHub instructions is to enter users' information including passwords.

If I have a private site where users have to have a password to login and use the site, how will the users know what their passwords are if I, as the admin, add the passwords? I think users of most private sites create their own passwords.

11 months ago

Please try to keep the forum clean

@pamtbaau:
Please don’t ask two different questions in one thread.

11 months ago

So I should have titled this topic "Question1 about Login Plugin'? Only one question? What should I call the next topic? "Question2 about Login Plugin"? Is that the proper thing to do? It seems to me to be cleaner for all my questions about the Login Plugin to be under one topic.

11 months ago

I've edited the title of this topic. This should hint how topics should be created to make forum more searchable and easier to read for other members

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 47 1 week ago
Plugins · by Xavier, 4 weeks ago
2 56 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1182 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 50 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 74 2 months ago