Feature Request: Add json_decode filter to Twig

Support MB Views Feature Request: Add json_decode filter to Twig

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #49301
    Michael KernMichael Kern
    Participant

    Hello all,

    I was trying to use template partials to construct custom schema using MB Views (I find Slim SEO's Schema to be lacking when it comes to nesting/linking IDs across objects). However, as I understand it, json_decode isn't an available filter in Twig without including it from Symfony's Twig Extras bundle. This is getting in the way of my trying to manually pretty print/minify my JSON output. Is this planning to be included in future releases of MB Views/MBAIO?

    Thanks!

    #49308
    PeterPeter
    Moderator

    Hello Michael,

    The filter json_decode is not supported by Twig officially so you can create a custom PHP code and call it in the View template, following the documentation https://docs.metabox.io/extensions/mb-views/#running-php-functions

    I will inform the development team to consider supporting this filter in future MB updates.

    Thank you.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.