0

I think this is quite a basic TV question but couldn't find an answer.

I have a TV called previewImage. Usually, it contains a static string. For some dynamic pages, the TV value is a tag [[getPreviewImage]] which returns dynamically an image file name.

I am using [[*previewImage]] as an input for another snippet in the template that generates a responsive IMG element. It works fine when the TV is a static string.

But if TV contains a snippet tag, it won't be processed before I am using it as a parameter. I tried also to use it in the form [[!*previewImage]] without luck.

How can I pre-process TV? I was able to make a workaround but what is the recommended way?

  • 1
    Here we are talking about when built-in MODX parser works with such nesting. How about try to use @CHUNK binding for TV value, using some chunk where your snippet is called. – Anton Tarasov Apr 27 '22 at 16:48
  • Thanks @AntonTarasov. That is something what came to my mind when I was browsing the documentation. I was unsure if the chuck would then be parsed first. – Niko Suominen Apr 28 '22 at 13:47

0 Answers0