Hi, just starting out with Grav and loving it so far. Till I’ve learned the file structure I’m sticking to the default theme and that’s what I need help with. How do I change the footer text? I’d like to add 2-3 columns with some contact information and what not.
The best way to find where something is defined is load the user
folder in a code editor (Sublime Text, Atom or any other) and search for a specific line that you’re looking for. It will point you to the right file.
To be more precise, I know where to edit the footer text. But I can’t find the actual “look” of the footer. I’ve added 4 lines of text in a
, however, the 4th line is halfway outside the page. The footer I found is just referring to a footer block, which I can’t find. I’ve been looking for hours…
If you are talking about the Antimatter theme, then look at /user/themes/antimatter/templates/partials/base.html.twig
. If it isn’t that, then it might be one of the other partials.
That’s the file I’m in. Can’t find anything relevant in the other partials. This is what I did. What I want is for the footer to wrap around the text, but there’s gotta be a max-height to the footer somewhere or something as the text break out of it.
{% block footer %}
<footer id="footer">
<div class="totop">
<span><a href="#" id="toTop"><i class="fa fa-arrow-up"></i></a></span>
</div>
<p>Powered by <a href="#">Grav</a>.</p>
<div class="left-text" style="float:left;text-align:justify">
Kontakt<br>
Hittepåvägen 3<br>
86000, City<br>
07X - XXXXXXX<br>
</div>
</footer>
{% endblock %}
This is how it ends up
Footer
Ah, right. So it is the CSS that must be the problem. I can’t really help with that, because my own theme is a child theme where I can make only the changes I need. Did you look in /user/themes/antimatter/css-compil ed/template.css
? I’m not a very advanced developer (I’m not a developer at all, really) so I often use the Web Inspector to see how an element is styled and then to test the changes needed to make it look how I want.
Looks like it! Awesome! Thanks, I got it from here. (I hope)
I suggest to be careful with modifying directly the antimatter theme. Definitely look at making a child theme, unless you are happy to never update the antimatter theme (which could then overwrite your own changes)
also, while it will work fine to modify the compiled css (assuming you never get into sass/less), it might be better to use the compiled css (or even the associated scss source files) just to identify the style you are trying to change. Then rather than modify that file. use your own custom.css file where you redefine the same style. It then keeps all your custom changes in one spot, which is easier to find later too. Sorry, I’m probably making it more complicated for you in the short term. https://learn.getgrav.org/themes/customization#custom-css
@dm9876
I suggest to be careful with modifying directly the antimatter theme. Definitely look at making a child theme
How do I do that then? Is there any easy way to just duplicate the theme with all my changes?
Reading the docs?
https://learn.getgrav.org/themes/customization#theme-inheritance
That’s what I did, and it worked for me!
I made my child-theme, however the custom.css doesn’t seem to co-operate. I made the file, and did a body a {#color;} just to see if it was working, now all links still show up in the color I set even tho I cleared the custom.css file. If I delete the file, the links go back to the initial color and if I create a new custom.css without even opening the file, they turn into the color I set before deleting the file. I’m confused and can’t find anything about it in the docs.
Are you clearing the cache between each page load? That can make a difference.
@jeremyc
Are you clearing the cache between each page load? That can make a difference.
Yes, I tried that. Tried with Firefox now tho and that’s working, gotta be something weird with my Chrome.
Right.