modxmodx-revolutionmodx-templates

MODX - Template variable that hides post author when checked


So I am using the add-on articles to create a press release section on my site. I need to create a template variable that is a check box and if checked it will NOT show the post author:

[[*publishedby:userinfo=`username`]]

What is the best way for me to do this.


Solution

  • If your checkbox tv input option value like "Hide==1" then use output filter like this:

    [[*your_tv:ne=`1`:then=`[[*publishedby:userinfo=`username`]]`]]