Page 1 of 2
how to pull the current date events
Posted: Tue Nov 15, 2011 10:26 pm
by Alpdog14
So I have a calendar that I am trying to pull today's event. I can pull both yesterdays and tomorrows by changing the parameters of:
{cms_module module="Calendar" display="upcominglist" limit="1" category="Drink Specials" detail="1" first_day_of_week="0"}
but does anyone know for display a parameter to show the current day events both upcominglist and just list either shows the next day event. I am trying to pull the current event
Re: how to pull the current date events
Posted: Wed Nov 16, 2011 5:13 pm
by Alpdog14
Come really no one has answered my post, I am really thinking about moving to Drupal
Re: how to pull the current date events
Posted: Wed Nov 16, 2011 6:19 pm
by Wishbone
I thought long and hard for a well-placed sarcastic remark to your threat of leaving us and inflicting Drupal with your demands, but came up with nothing.
'Calendar' hasn't been supported for a while. CGCalendar is the current best choice for calendaring in CMSMS. However, this doesn't have this feature as well. Luckily CMSMS makes use of Smarty and PHP, and it should be semi-easy to write an upcoming list template that loops through the upcoming list and filters out ones that don't match today's date.
Re: how to pull the current date events
Posted: Wed Nov 16, 2011 6:27 pm
by uniqu3
Well you can always create another upcominglist template and use $smarty.now.
Code: Select all
.... the template ...then comes foreach fro events
{foreach from=$events key=key item=event}
{if $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' == $event.event_date_start|date_format:'%Y-%m-%d %H:%M:%S'}
...the rest of template in the foreach ...
{/if}
{/foreach}
... and the rest of template...
Hope you get the idea.
Edit: oh we are talking about Calendar, but basically should be same thing, just check if events date equals todays date.
CMSMS uses Smarty so first stop to learn, read find a solution when you are stuck is Smarty documentation
http://www.smarty.net/docsv2/en/
Re: how to pull the current date events
Posted: Wed Nov 16, 2011 6:36 pm
by Alpdog14
Thanks for the reply, do you have another other code examples that have the full code in it, I can still use help
Re: how to pull the current date events
Posted: Wed Nov 16, 2011 7:02 pm
by Wishbone
You might want to leave off the ' %H:%M:%S' from his example... This will cause the template to only show you calendar items that match this exact second.

Re: how to pull the current date events
Posted: Wed Nov 16, 2011 7:15 pm
by uniqu3
@Wishbone he he lol true

Re: how to pull the current date events
Posted: Wed Nov 16, 2011 7:42 pm
by Alpdog14
Ok so I completely removed the old Calendar module and installed the CGCalendar module. I see its similar to the old but when I load my calendar I get this error above my calendar:
Warning: Parameter table_id is not known by module CGCalendar dropped in /home/content/j/e/t/jetshouse/html/lib/misc.functions.php on line 1590
Do you know how to fix this?
Re: how to pull the current date events
Posted: Wed Nov 16, 2011 7:55 pm
by Wishbone
They are not compatible. You could probably use the same or similar technique on the old calendar module.
Re: how to pull the current date events
Posted: Wed Nov 16, 2011 7:58 pm
by Alpdog14
so what does that mean, the most recent version of CMSMS (1.10.1) does not support the most recent CGCalendar module?
Re: how to pull the current date events
Posted: Wed Nov 16, 2011 8:08 pm
by Wishbone
I meant that Calendar and CGCalendar aren't compatible.. Did you save an XML of the Calendar and try to load it in CGCalendar? Did it work? (aside from the error)
Re: how to pull the current date events
Posted: Wed Nov 16, 2011 8:09 pm
by Wishbone
Are you passing a table_id parameter? The error message usually means that your specifiying a parameter that doesn't exist.
Re: how to pull the current date events
Posted: Wed Nov 16, 2011 8:11 pm
by Alpdog14
where do i put this table id, in the server side file or in the CMSMS editor with the {cms_module module="CGCalendar" table_id="big" display="calendar" category="Events" first_day_of_week="0"} code
Re: how to pull the current date events
Posted: Wed Nov 16, 2011 8:13 pm
by Wishbone
I see.. look at the help for the module.. I don't believe there's a table_id option for CGCalendar.
Re: how to pull the current date events
Posted: Wed Nov 16, 2011 8:15 pm
by Alpdog14
So your saying I need to add this on the files on the server?