List of Events UDT Calendar

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
zis
New Member
New Member
Posts: 4
Joined: Fri Nov 25, 2011 11:54 am

List of Events UDT Calendar

Post by zis »

Hi,

I used CGCalendar (1.9) or Calendar (0.8.2). I need to create an UDT which prints an output in javascript array form like:

Code: Select all

var events = [
    { Title: "Five K for charity", Date: new Date("06/19/2012"), Link: "/cz/aaa/.25.5.html" },
    { Title: "Dinner", Date: new Date("06/25/2012"), Link: "/cz/bbb/.25.5.html"  }
];
In example are 2 events with event title, date and link. So I need to used (CG)Calender but for output I used jquery datepicker. Datepicker needs an input in form javascript array mentioned above.

Do anyone know how can I create the array from (CG)Calendar events in UDT?

Thanks for ideas,
Regards
John
Zoorlat

Re: List of Events UDT Calendar

Post by Zoorlat »

Hi,

Not sure I understand what you are doing with the datapicker, but to get the calendar data into a js-array you don't need a UDT. You could do this as a template, with some smarty logic. Then just call that template where you need the js-output in your page.

The only "trick" you need is to encode the curly brackets needed in you javascript with {ldelim}, {rdelim}.

See:
http://www.smarty.net/docsv2/en/languag ... ldelim.tpl

Good luck.
zis
New Member
New Member
Posts: 4
Joined: Fri Nov 25, 2011 11:54 am

Re: List of Events UDT Calendar

Post by zis »

Thanks for reply,

this js-array is used for events highlighting in datepicker. I am newbie in CMSMS.

Smarty template, you mean in admin Layout->Templates? If you mean it, how can I get access to Calendar data throught Smarty?

Thanks
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: List of Events UDT Calendar

Post by Jos »

Search for the templates button in the CGCalender admin section
Post Reply

Return to “The Lounge”