pdoResources Output Filters Not Functioning

I am using pdoResources and a Collections resource to build a calendar listing of events. However, I can’t seem to get output filters to work on the template variables in the chunks. I have only ever used getResources before and I’m not sure the issue. Thanks for any insight.

[[!pdoResources?
    &parents=`[[*id]]`
    &showHidden=`1`
    &sortby=`publishedon`
    &sortdir=`desc`
    &includeTVs=`buttonText,eventDate,eventImage,eventLocation,eventLocationLink,eventTime,eventLinkExternal`
    &tvPrefix=`tv.`
    &processTVs=`1`
    &includeContent=`1`
    &tpl=`eventTpl`
]]

eventTpl

<!-- Event -->
<div class="card mb-3" style="">
  <div class="row g-0">
    <div class="col-lg-6">
      <img
        src="[[+tv.eventImage]]"
        class="img-fluid rounded-start"
        alt="[[+pagetitle]]"
      />
    </div>
    <div class="col-lg-6">
      <div class="card-body">
        <h1 class="card-title">[[+pagetitle]]</h1>
        <h4 class="my-3"><i class="fa-regular fa-calendar"></i>&nbsp;&nbsp;[[+tv.eventDate]]</h4>

        <h5 class=""><i class="fa-regular fa-clock"></i>&nbsp;&nbsp;[[+tv.eventTime]]</h5>
        <p class="card-text">
          [[+content]]
        </p>
        <i class="fa-solid fa-location-dot px-2"></i>
[[+tv.eventLocationLink:notempty=`<a href="[[+tv.eventLocationLink"]] target="_blank">[[+tv.eventLocation]]</a>`:else=`[[+tv.eventLocation]]`]]
        </p>

[[+tv.eventLinkExternal:notempty=`<a href="[[+tv.eventLinkExternal]]" target="_blank" class="btn btn-lg btn-danger w-100">[[+tv.buttonText]]</a>`:else=`<a href="[[+tv.eventLinkExternal]]" class="btn btn-lg btn-danger w-100">[[~[[+id]]]]</a>`]]

      </div>
    </div>
  </div>
</div>

What parts exactly don’t work?


Output filters should work the same with pdoResources.


I don’t think you can combine the notempty output filter with an else clause:

[[+tv.eventLocationLink:notempty=`...`:else=`...`]]

You are correct, I had to use isempty and not notempty for that to work. Thanks!

Just jumping in here, yes, I’ve run into that before too. isempty tends to be more reliable when you want to provide a fallback. Also, sometimes it helps to double-check if the TV is returning an empty string or something like “0”, since that can affect how the filters behave. Glad you got it working!

Thanks! I had to switch back to getResources from pdoResources and it fixed almost everything. No idea why. It’s a small site with little regularly added content so the speed cost isn’t a big deal.