Where to put template code?

Hiya - fantastic plugin.

I’m attempting to set up a calendar in wordpress… and need to do various tweeks in the templates. On this page docs.dhtmlx.com/doku.php?id=dhtm … om_styling there are bits of code like:

scheduler.templates.event_class=function(start,end,event){
if (start < (new Date())) //if date in past
return “past_event”; //then set special css class for it
}

Which look like they will do the job. Whereabouts do I put this code though? Is there a file somewhere?

Please refer to the excellent set of tutorial. Theses are great start while learning about DHTMLX.

http://docs.dhtmlx.com/doku.php?id=tutorials:toc

From my personal experience getting through few of them is the best way to quickly adapt the components into your own apps :slight_smile:

Hi - thanks for getting back to me.

re: Tutorials - that’s about 12 long pages of stuff… the one that looks like it’s about the scheduler is written for ASP, and seems to want me to put the JS in an “index” file, which appears not to exist in the Wordpress version, which lives in a “views” folder, which also appears not to exist in the Wordpress version.

So… thanks for your help, but it would kindof be more useful just to know which file

scheduler.templates.event_class=function(start,end,event){
if (start < (new Date())) //if date in past
return “past_event”; //then set special css class for it
}

Needs to go in?

Hey Nick,

If that’s the case, I would refer you to the Lessons for Theme Development of the http://codex.wordpress.org/WordPress_Lessons pages… I am certain you’ll find the best way to customize your WP site with dhtmlx there :slight_smile:

I am not familiar with WP development myself so I guess that would be a great place to start.

Good luck!

Hello,

Plugin version includes admin’s section to modify settings including templates.

Kind regards,
Ilya

Yes - I saw those.

But where do I put the code

scheduler.templates.event_class=function(start,end,event){
if (start < (new Date())) //if date in past
return “past_event”; //then set special css class for it
}

?

Do I just copy and paste it into the template in the admin form? If so, where? Because I’ve tried that, and it throws an error… of the type that would indicate that this is not in fact where the code needs to go.

Is there someone here who actually knows how to add the code above… as outlined here?

docs.dhtmlx.com/doku.php?id=dhtm … om_styling

Hi,
you may add it into file wp-content/plugins/event-calendar-scheduler/scheduler_include.html like here:

<script>
// your template is here
</script>