getPage, getResources Noob Question

Greetings All,

I have what I suspect must be a very simple question. I have the following snippet call for an events page I am building:

[[!getPage@SchedulePagination?
   &element=`getResources`
   &parents=`132`
   &tpl=`CalendarEventRowTpl`
   &sortbyTV=`Calendar_EventDateStart`
   &sortdirTV=`ASC`
   &includeContent=`1`
   &processTVs=`1`
   &includeTVs=`1`
   &showHidden=`1`
   &limit=`6`
   &pageNavVar=`page.nav`
]]

<ul class="pagination">						     
   [[!+page.nav:notempty=`
      [[!+page.nav]]
      <p class="">Page [[+page]] of [[+pageCount]]</p>
   `]]
</ul>

This works fine, in that it correctly returns all the events that are currently published, and additionally, the pagination code does not display if there are no events currently published.

However, when there are no events currently published, I would also like to be able to display a chunk that basically says “There are no current events. Please check back later.”

How do I do that?

Thanks for the help!

I believe you can use the toPlaceholder property and then check if the result is empty with an output modifier like default or empty.

[[!getPage?
   ...
   &toPlaceholder=`myevents`
]]

[[!+myevents:default=`<p>There are no current events. Please check back later.</p>`]]
1 Like

Worked like a charm! Thank you so much! I truly do appreciate the help!