0

we are running commerce site, still tweaking some bits, so we have still twig debug set to true, but site is already online.. we have XML feed for exporting commerce products to couple of price comparison sites.. and XML feed is of course marked as invalid, because even in XML views feed are html theme suggestion comments, any chance to turn off those for particular view?

Thank you.

<SHOP xmlns="http://www.zbozi.cz/ns/offer/1.0">
    

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'xmlfeedviews_row' -->
<!-- BEGIN OUTPUT from 'modules/contrib/xmlfeedviews/templates/xmlfeedviews-row.html.twig' -->
<SHOPITEM>
    <PRODUCTNAME>

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'views_view_field' -->
<!-- BEGIN OUTPUT from 'core/modules/views/templates/views-view-field.html.twig' -->
Náhradní filtry k ionizátorům H2
<!-- END OUTPUT from 'core/modules/views/templates/views-view-field.html.twig' -->

</PRODUCTNAME>
<DESCRIPTION>

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'views_view_field' -->
<!-- BEGIN OUTPUT from 'core/modules/views/templates/views-view-field.html.twig' -->
Životnost filtrů je 1000 galonů (3800 litrů). Vyměnit filtry k ionizátoru není složité a zvládnete to sami.

<!-- END OUTPUT from 'core/modules/views/templates/views-view-field.html.twig' -->

</DESCRIPTION>
<URL>

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'views_view_field' -->
<!-- BEGIN OUTPUT from 'core/modules/views/templates/views-view-field.html.twig' -->
https://www.fitvoda.cz/nahradni-filtry-k-ionizatorum-h2
<!-- END OUTPUT from 'core/modules/views/templates/views-view-field.html.twig' -->

</URL>
<PRICE_VAT>

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'views_view_field' -->
<!-- BEGIN OUTPUT from 'core/modules/views/templates/views-view-field.html.twig' -->
4990.00
<!-- END OUTPUT from 'core/modules/views/templates/views-view-field.html.twig' -->

</PRICE_VAT>
... etc
1
  • Don't enable twig debugging on live sites.
    – sonfd
    Commented Jan 18, 2022 at 14:36

1 Answer 1

1

No, I don't think you can turn off twig debugging for only some parts of the site. It's either on or it's off.

Anyway, you are risking a lot of trouble making changes to a live site. It's much better to set up a local development environment and make your code changes locally. One cross-platform tool for this is Lando but there are many others as well. Drupal.org has a full guide on local server setups.

Also, the documentation specifically states that Twig debugging can break parts of the site, including views. See this issue.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.