Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thampe/zurbinkbundle
Creating email templates is hard. This Symfony Bundle provides help.
https://github.com/thampe/zurbinkbundle
Last synced: 25 days ago
JSON representation
Creating email templates is hard. This Symfony Bundle provides help.
- Host: GitHub
- URL: https://github.com/thampe/zurbinkbundle
- Owner: thampe
- License: mit
- Created: 2013-11-24T14:31:13.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2018-10-30T11:49:23.000Z (about 6 years ago)
- Last Synced: 2024-11-13T20:43:26.587Z (about 2 months ago)
- Language: HTML
- Size: 63.5 KB
- Stars: 56
- Watchers: 5
- Forks: 37
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# This repository is no longer maintained.
Issue reports and pull requests will not be attended. There seems to be an _active_ fork. You might want to you [this](https://github.com/gremo/ZurbInkBundle) instead.# ZurbInkBundle (Foundation for Emails 2)
Creating email templates is hard.
This Symfony Bundle provides some help:* [Foundation for Emails 2](https://github.com/zurb/foundation-emails) Integration for awesome and responsive emails. Checkout their [documentation](http://foundation.zurb.com/emails.html).
* Use normal CSS files for styling, add them via `{{ zurb_ink_styles.add("@YourBundle/Resources/public/css/styles.css") }}`.
* Automatic inline styles via the `{% ìnlinestyle %}` tag (powered by [Tijs Verkoyen's CssToInlineStyles](https://github.com/tijsverkoyen/CssToInlineStyles)).
* Imports your CSS rules also in html head via `{{ includeStyles(zurb_ink_styles) }}`
* **New in 2.0:** [Inky](https://github.com/zurb/inky)-Template Support via the `{% inky %}` tag (powered by [https://github.com/thampe/inky](https://github.com/thampe/inky))## Installation
You can install this bundle using composer
composer require hampe/zurb-ink-bundle
or add the package to your `composer.json` file directly.Php 5.4 is now required. Make sure your composer.json, does not set the platform to php 5.3.*:
"config": {
"bin-dir": "bin",
"platform": {
"php": "5.4.0"
}
},After you have installed the package, you just need to add the bundle to your AppKernel.php file:
// in AppKernel::registerBundles()
$bundles = array(
// ...
new Hampe\Bundle\ZurbInkBundle\HampeZurbInkBundle(),
// ...
);## Usage
### Option A: Extend the base.html.twig
If you want to use the zurb ink framework, extend the `HampeZurbInkBundle::base.html.twig`.{% extends 'HampeZurbInkBundle:FoundationForEmails:2/base.html.twig' %}
{% block preHtml %}
{# add your css files here, please use a bundle relative path #}
{{ zurb_ink_styles.add("@YourBundle/Resources/public/css/style1.css") }}
{{ zurb_ink_styles.add("@YourBundle/Resources/public/css/style2.css") }}
...
{% endblock %}
{% block content %}
{# html #}
{% endblock %}
{% extends 'HampeZurbInkBundle::base.html.twig' %}---
*Note:* If you prefer not to have the CSS-Styles also in the `` of your HTML-Document, you can override the `headStyles`-Block: `{% block headStyles %}{% endblock %}`. Be aware that some CSS-Rules can't be realized with inline-styles, like `:hover`-States or `@media`-Queries (both uesed by ZURB Ink Framework)!
### Option B: Write your own template from scratch
{% spaceless %}
{# add your styles before the inlinestyle tag #}
{{ zurb_ink_styles.add("@YourBUndle/Resources/public/css/style.css") }}
{% inlinestyle %}
{% block headStyles %}
{% autoescape false %}
{{ includeStyles(zurb_ink_styles) }}
{% endautoescape %}
{% endblock %}
{% inky %} {# inky-tag for inky-template support #}
{% block body %}
{% block content %}{% endblock %}
{% endblock %}
{% endinky %}
{% endinlinestyle %}
{% endspaceless %}
## License
See the [LICENSE](LICENSE) file for license info (it's the MIT license).