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

Best approach to modify style of contact form?

Started by Muut Archive 11 years ago · 3 replies · 439 views
11 years ago

I want to add a simple contact form on my page. For my whole website I use bootstrap.
What is the best approach to style it with the bootstrap classes?
I found now way yaml option in the form.md, so that I can add a custom css classes for styling for certain elements. I also found nothing in the docs regarding custom styles.

Of course I could style the existing classes in the elements, however that would require me to copy the styles of the bootstrap classes in the new classes... Nevertheless I will miss some layout classes

11 years ago

yeah, I did this now. Copied the field.html.twig file in my template folder and modified it.
What I found really difficult and still not really understand is, what template include what other template. There is some documentation really necessary.

11 years ago

In twig files you have for example: {% include "forms/data.html.twig" %} . That means you have to look for data.html.twig in templates/forms/data.html.twig or if it does not exist, then it's inherited from plugin: user/plugins/form/templates/forms/data.html.twig . This is called inheritance. You can overwrite each file by copying it to your template directory.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1350 9 years ago
Archive · by Muut Archive, 9 years ago
2 934 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2947 9 years ago
Archive · by Muut Archive, 9 years ago
3 1118 9 years ago