How to add a custom block to a page type

Permalink
Hello, I am new to C5.

I have created a custom block with form elements that have js checks to ensure specific fields are being filled in. When creating through admin a new page type and adding the custom block as a default block in the Main area, the js checks fire that prevent me from completing the page type setup with a blank custom block.

Does anyone have any ideas how I might solve/ work around this?

Many thanks,

Roy

 
hutman replied on at Permalink Reply
hutman
You could add a check to see if the page is in Edit Mode and if so do not fire/include the JS for the block.

if(!$c->isEditMode()){ fire/include js }