处理MODX模板变量
我有一台名为PreviewImage的电视。通常,它包含一个静态字符串。对于某些动态页面,电视值是一个标签[[getPreviewImage]],它可以动态返回图像文件名。
我正在使用[[**PreviewImage]]作为生成响应式IMG元素的模板中另一个片段的输入。当电视是静态字符串时,它可以正常工作。
但是,如果电视包含摘要标签,则在将其用作参数之前不会进行处理。我也尝试以[[!**PreviewImage]]的形式使用它。
我如何预处理电视?我能够进行解决方法,但是推荐的方法是什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论