Twig: prevent parsing of client-side templates

Twig
I need to output a portion of client-side handlebars templates, which has tags similar to twig's 'say' tags: <script type="text/x-handlebars"&gt...
1 year ago

Twig block USE in IF block

Twig
I render same page in modal and self. I wonder if there is some way to check for some condition and if condition is true not to include header and fo...
1 year ago

Using twig variable inside load jQuery

Twig
I have a problem with including twig inside load function of jQuery, here is an example: <!-- src/MyBundle/Ressources/views/index.html.twig -->...
1 year ago

Match sub-string is the twig

Twig
I am developing a new drupal8 website and I can't work out what I am doing wrong! All I need to do is find if a sub-string exists in the variable call...
1 year ago

Compare date with a specific one and DateTime to string in Twig

Twig
How can I compare two dates in Twig when the first one comes from the dababase and the second is clear - 2012-12-31? I tried with {% if dom.dueD...
1 year ago

What is the difference between include and block in Twig?

Twig
I'm trying to make a bootstrap theme for PhileCMS which uses Twig. Right now I'm working on the menu. I've been searching to find out how to make a pa...
1 year ago

A solution for grouping items in loop with Timber and Twig

Twig
Often i need to do some tricky layout on dynamic elements like galleries. Here's one example: <ul> <li class="slide"> <img src="im...
1 year ago

Can an object tell Twig not to escape output when it is {{ printed }}

Twig
I've got a situation where some variables sent to my Twig templates are plain old variables, so I want them to be html-escaped (as is the default beha...
1 year ago

Symfony-Twig: insert fontawesome icon in a form_widget

Twig
To validate a form I am using a standard: {{ form_widget(form.save, {'attr': {'class': 'btn btn-sm btn-danger'}, 'label': 'Submit form'}) }} I want...
1 year ago

Display something only once in a loop in twig

Twig
I have some pics that I want to display by months. But I my code I get the month on top of every pics. How to avoid this ? {% for media in med...
1 year ago

double-quotes making problems in google

Twig
I used the replace function in twig to remove the unwanted pieces of the function and it is working perfectly except it still contains the double-quot...
1 year ago

How to get the current user in twig extension service [symfony2.8]

Twig
I'm trying to get the current user in my NotificationExtension.php. But the page become very slow to load and I also get this error: Error: Call t...
1 year ago

Find missing "empty" translation in Symfony project

Twig
While checking the logs of my Symfony 2.8 project I came across the following warnings: Translation not found. Context: { "id": "", "domain": "messa...
1 year ago

Forcing the Twig Locale

Twig
I would like to use the Twig template system to template my e-mails. The locale of the e-mail should be based on a user setting, not from the session ...
1 year ago

Symfony dynamic wildcards in google maps infowindow

Twig
I have a small application in Symfony3 with a google map showing some locations injected from the database. What I am trying to achieve is to place a ...
1 year ago

Drupal 8 how to pass a value to menu twig template

Twig
I am new to Drupal, I want to pass domain URL to use in menu.html.twig template. How can I do this. Actually I have a menu of 5 domains all pointing t...
1 year ago

Can I put html inside a Symfony form button with Twig?

Twig
I'm trying to put html inside a form button with twig like: {{ form_widget(form.jiraStatus, { 'label': '<i class="fa fa-bug"></i>...
1 year ago

Twig function return a template

Twig
Is it possible for a twig function to return a twig template? For example class ToTimeExtension extends \Twig_Extension { public function getF...
1 year ago

symfony 3 twig template function if

Twig
this function function test(){ var distance =calculateHaversineFormula({{lat}}, {{lng}},{{ geocode.latitude}}, {{ geocode.longitude }} ); ...
1 year ago

laravel csrf tokens with Twig

Twig
In Laravel the main app template has the following line <script>window.Laravel = <?php echo json_encode(['csrfToken' => csrf_token(),]); ...
1 year ago