• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: List of Events UDT Calendar
PostPosted: Mon Jun 18, 2012 10:54 am 
Offline
New Member

Joined: Fri Nov 25, 2011 11:54 am
Posts: 4
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:
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


Top
 Profile  
 
 Post subject: Re: List of Events UDT Calendar
PostPosted: Mon Jun 18, 2012 11:33 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Nov 15, 2006 12:42 pm
Posts: 154
Location: London, UK
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/language.function.ldelim.tpl

Good luck.


Top
 Profile  
 
 Post subject: Re: List of Events UDT Calendar
PostPosted: Mon Jun 18, 2012 2:39 pm 
Offline
New Member

Joined: Fri Nov 25, 2011 11:54 am
Posts: 4
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


Top
 Profile  
 
 Post subject: Re: List of Events UDT Calendar
PostPosted: Mon Jun 18, 2012 3:06 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Sep 05, 2007 8:03 pm
Posts: 3642
Location: The Netherlands
Search for the templates button in the CGCalender admin section

_________________
Get nice guestbook messages from your site visitors with the brand new Gbook module.
Integrate Piwik Web Analytics in your site admin with the Piwik module.
Extend your global site settings with the Custom Global Settings module.
The Fourth Dutch CMS Made Simple Workshop on April 9 2011 was great fun! Read all about it here
Announcement: The Fifth Dutch CMS Made Simple Workshop coming up?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting