Skip to content

Instantly share code, notes, and snippets.

@rkamradt
Last active September 24, 2020 12:24
Show Gist options
  • Save rkamradt/a1729a7f417e7b9837440a463beae636 to your computer and use it in GitHub Desktop.
Save rkamradt/a1729a7f417e7b9837440a463beae636 to your computer and use it in GitHub Desktop.
Basic twig template including Bootstrap 4
{# templates/base.html.twig #}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>{% block title %}Wine List{% endblock %}</title>
{% block stylesheets %}
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
#backgroundimage
{
height: auto;
left: 0;
margin: 0;
min-height: 100%;
min-width: 674px;
padding: 0;
position: fixed;
top: 0;
width: 100%;
z-index: -1;
}
</style>
<!-- Le styles -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link rel="shortcut icon" href="{{ asset('ico/favicon.png') }}">
{% endblock %}
</head>
<body>
<img id="backgroundimage" src="{{ asset('img/nos-small.JPG') }}" border="0" alt="">
{% block body %}
<div class="container-fluid">
{% block container %}
<h1>Wine List</h1>
<div class="btn-group" role="group" aria-label="Basic example">
{% block buttons %}
<a href="/list" class="btn btn-primary btn-large">List</a>
<a href="/about" class="btn btn-primary btn-large">About</a>
<a href="/" class="btn btn-primary btn-large">Home</a>
{% endblock %}
</div>
<div id="content">
{% block content %}
{% endblock %}
</div>
{% endblock %}
</div>
{% endblock %}
{% block javascript %}
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
{% endblock %}
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment