0
Welcome Guest! Login
0 items Join Now

Conflict with TWIG

  • Conflict with TWIG

    Posted 3 years 1 month ago
    • I'm having a TWIG conflict between this framework and Metabox (which both uses TWIG for theming). Metabox is an advanced custom field plugin and using TWIG for frontend display of the custom field. When I'm not using the gantry framework it works just fine but when I do I get this error on this page:

      Cannot redeclare twig_array_reduce() (previously declared in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Extension/CoreExtension.php:1720)

      3.137.50.200/message/test-message/


      I'm hoping you can help solve this error in Gantry. Thanks so much!
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Conflict with TWIG

    Posted 3 years 1 month ago
    • It's probably using a different TWIG version to us so delete the TWIG folder from the vendor file of that plugin so that it uses our version. If the plugin expects to be using the latest version of TWIG then it may not be possible to use the extension.

      Sorry but we can't guarantee compatibility with every third-party plugin that might exist.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: Conflict with TWIG

    Posted 3 years 1 month ago
    • Thanks so much for your quick reply and explanation. Can you tell me which TWIG version you currently use and also where I can look that up as gantry gets updated in the future.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Conflict with TWIG

    Posted 3 years 1 month ago
    • TWIG version used by Gantry 5 is 1.42.5

      You can always check by putting
      <p>Twig version is {{ constant('Twig_Environment::VERSION') }}</p>

      In a customhtml particle somewhere on one of your layouts and ensuring that your have the "process TWIG" box checked - the version will then show wherever you put the particle.

      Regards, Mark.
    • The following users have thanked you: Gene Teigland

    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.

Time to create page: 0.065 seconds