[SOLVED] CGCalendar upcominglist with no entries

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm
Location: Calgary, Alberta, Canada

[SOLVED] CGCalendar upcominglist with no entries

Post by tophers »

I'm using:
CMSMS - 1.11.3
CGCalendar - 1.10.0.1

When using 'upcominglist', when no entries are upcoming the template seems to not be processed at all. I'm trying to insert a default message if there are no events pending, using:

Code: Select all

{if $events|@count < 1}
    There are no calendar events pending.
{/if}
In other templates ('listtemplate', for instance), this is processed and displays properly. But in the 'upcominglist' template it's never processed at all - it's like a routine is run in the background to do an event check beforehand, and just bypasses the template altogether.

Is this possible with the 'upcominglist'? If so, what do I need to alter?
Last edited by tophers on Fri Feb 22, 2013 6:31 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: CGCalendar upcominglist with no entries

Post by calguy1000 »

/me thinks that the template doesn't get called if there are no matching events.

so you could do something like:

Code: Select all

{CGCalendar display=upcominglist assign=foo}
{if $foo == ''}
   <div class="message">No matching events</div>
{else}
   {$foo}
{/if}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm
Location: Calgary, Alberta, Canada

Re: CGCalendar upcominglist with no entries

Post by tophers »

Thanks - it now works part of the time. The 'no events pending' portion displays exactly as planned. I now have an issue with displaying actual events - I have a limit set (2), and that seems to break things:

Code: Select all

{CGCalendar display="upcominglist" listtemplate="Upcoming" category="Human Resources" detailpage="calendar-is" limit="2" assign="pending"}
{if $pending == ''}
   {global_content name='calendar_pending'}
{else}
  {$pending}
{/if}
If I remove the limit parameter all is good - but I get a really, really long list and this is being used on a landing page where I just need the two newest events to show. Any thoughts?
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm
Location: Calgary, Alberta, Canada

Re: CGCalendar upcominglist with no entries

Post by tophers »

Sorry - ignore that last post. It's working fine - I have some other logic in the template (to exclude events that span multiple days before and after today's date) that is conflicting with the call. When I remove that all is good.

Thanks again!
Post Reply

Return to “Modules/Add-Ons”