Quantcast
Channel: User mlllmmlml - Stack Overflow
Viewing all articles
Browse latest Browse all 11

How to exclude part of the code with TWIG?

$
0
0

I have a Drupal 8 TWIG file with this code :

<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4 p-0 text-center"><i class="far fa-heart fa-lg"></i> {{ product.flag_like_product }}</div>

Is it possible to exclude the following code :

<div class="flag flag-like-product js-flag-like-product-14 action-flag"><a title="" href="/fr/flag/details/flag/like_product/14?destination=/fr/boutique/exemple-dune-boutique" class="use-ajax" data-dialog-type="modal" data-dialog-options="{&quot;width&quot;:&quot;auto&quot;}" rel="nofollow"><span class="btn btn-outline-success btn-sm"><i class="far fa-heart fa-lg"></i> J'aime</span></a></div>

Here is the rendering of the code :

<div class="row p-0 m-0"><div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4 p-0 text-center"><i class="far fa-heart fa-lg"></i><div class="bs-field-like-link"><div class="flag flag-like-product js-flag-like-product-14 action-flag"><a title="" href="/fr/flag/details/flag/like_product/14?destination=/fr/boutique/exemple-dune-boutique" class="use-ajax" data-dialog-type="modal" data-dialog-options="{&quot;width&quot;:&quot;auto&quot;}" rel="nofollow"><span class="btn btn-outline-success btn-sm"><i class="far fa-heart fa-lg"></i> J'aime</span></a></div></div><span class="bs-field-like-count">      1</span></div><div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4 p-0 text-center"><i class="far fa-comment fa-lg"></i> 0</div><div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4 p-0 text-center"><i class="fas fa-share-alt fa-lg"></i> 0</div></div>

Viewing all articles
Browse latest Browse all 11

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>