Template Fragments in Flood\Canal
Fragments are small code parts which are written for a dynamic use, some need to get variables.
They should be inserted like:
{% include 'fragment/some-fragment.twig' with {'key': 'val'} %}
Google Maps Api
fragment/google-maps.twig
Embeds Google Map, could be used with a Google API Key (Google Static Maps API) or Google Maps Embed API.
Variables
google_mapstype:apiorembed, switches between api modesapi_key: Google Api Key, if exists and needed (Google Static Maps Api)query: Position query (Google Static Maps Api)embed: Embed code, GET parampb(Google Maps Embed Api)
Example, embed:
{% include 'fragment/google-map.twig' with {
'google_maps': {
'type': 'embed',
'embed': '<your-embed-code>'
}
} %}
Contact Form /simple
fragment/contact.twig
As simple contact form.
HTML selector Contact Form /simple
.canal--contact-formon the<form>- fields in the order they are defined
- fields are posted with name
contact_form[<id>][<field-key>] - each field with
<label>, iflabelis defined <input|mixed>withdivinput-grouparound, if<label>is existing, label first then input.canal--contact-form--input-group .input-group
- optional
placeforplaceholder="{{ val }}"
Variables Contact Form /simple
contact_form:id: unique id, for multiple per-page usage : stringprivacy: truemethod:POSTaction: url.generator.generate(contact)field: input field that should be shownname:placetype:text(email|tel|number)|checkbox|textarea|hiddenreq:required| optionallabel: string | optional
email:placereq| optional
tel:placereq| optional
msg:place
button:label:absenden
Example, embed:
todo
Navigation: Header
.nav-header {}
Navigation: Service
.nav-service {}
All available variables
The <head>has some default values, which didn't need not be set but are recommended. You could set them through your controller. The content controller will push those set in a meta content file to the template.
When nested, the childs are array items, with () at the end are object methods:
headtitleused for<title>authorused for<meta name="author"descriptionused for<meta name="description"fontused for<link href="{{ head.font }}" rel="stylesheet">
metadescriptionused for<meta name="description"langused for<meta name="description"and as for thelangattribute of<body>
bodyclassarray, will be concated with spaces as classes for<body>attrarray, will be concated with spaces as attributes for<body>
frontenddebugbool
Created | Last Update