Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hello fellow CouchCMS-Users.
Since I haven't found anything after an 10 minute internet search: Is there a possibility to use javascript in Templates?

As example to display the current date/time in a field.

Thank you for your awnsers!

- Helagon

On the frontend - Couch remains agnostic of what you put in your templates (i.e. you are free to use whatever JS you wish).
On the backend - there are several ways to 'inject' custom JS in the admin-panel.

Could you please explain in detail exactly what you are planning to do? That'd help in framing a more helpful answer.

Hi KK!

I have this event calendar for an event which usually takes place every saturday. In this template I insert some specific information of the event such as where we meet or what do we have to take with us for this event.

I would like to automatically change the date for the date field to the next saturday, but still be able to change it manually to some other date. Next to that I have a field where I can set the date when an email will be send, which I want to set to the current date.

I've tried doing this with setting the default value of the editable, but that stays static.

I can do the JS/JQuery part, I just need to know how Couch actually allows js functions in the admin panel.

Thanks in Advance!

- Helagon
I just need to know how Couch actually allows js functions in the admin panel.

Ok. Please take a look at the following post and you'll find several ways of customizing your admin-panel -

The easiest for your use-case, I think, would be the use of <cms:script> block within <cms:config_form_view> e.g. as follows -
Code: Select all
        $( function(){

Hope this helps.
Thank you!
That helped!
5 posts Page 1 of 1