cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jmsmit49
Community Participant

Custom JavaScript in Canvas Catalog

Jump to solution

I'm trying to add custom JS that has worked in the past to replace the text that appears in the gray box on the registration pages (image attached). The script we use is:

if (window.location.pathname == "/browse/courseinfohere") {
$('span.ProductEnrollment__Notice').text('text here');
}

I've applied this to multiple catalogs in the customizations but it doesn't seem to working on any catalog anymore. Has anyone else added customizations to their back end before and had trouble saving? I keep getting the error "there was an error saving the catalog" 

I've cleared my cache and re-added the customizations, but I still get the same error. Maybe there's an update I'm missing?

Thanks!

Jackie S. 

Tags (2)
1 Solution

Accepted Solutions
stuart_ryan
Community Coach
Community Coach

Hi  @jmsmit49 ,

Apologies for the delayed reply, that would align (if memory serves me correctly) with the changes that happened in Catalog around that time.


As custom JS is unsupported, this can often be difficult to track down, there may have been a security related change that could have caused this, I would recommend reaching out through your CSM to see if they are able to find any additional details out for you.

Kind Regards,
Stuart

View solution in original post

6 Replies
chofer
Community Coach
Community Coach

Hello there,  @jmsmit49 ...

While I do not really have an answer for you, I wanted to let you know that I am going to share your question with someone at Instructure who may know more about this.  Hopefully he will be able to chime in.  Also, I am going to share your question with the Canvas Developers‌ and Catalog Users Group groups here in the Community in hopes that your question will get some additional exposure.  If you aren't yet following either of these groups, click on the links that I have provided, and then click on the "Follow" button located at the top right corner of the screen.  Next to that button is a link for "Actions".  Go there, and then select "Join group".  I hope this will be helpful to you, Jaclyn.  Good luck!

stuart_ryan
Community Coach
Community Coach

Hi Jaclyn,

I have had a bit of a look and confirmed I see the same behaviour on my Catalog, I will admit JS and Catalog is not something I have delved into heavily before. I wanted to check in however, do you know when this started happening (that you could not save) and particularly when the actual Javascript stopped working on your pages?

I know that there was a Catalog release rather recently, so I am wondering whether this is something that has changed in what JS is permitted, or possibly may be a bug (which may mean a ticket to support).

Please let us know the rough timeline and I can then see if that aligns with the release schedule.


Hope that helps!

Stuart

jmsmit49
Community Participant

Hi  @stuart_ryan ‌

The last time I applied this code and it worked was at the end of July. The next time I tried it was this past Friday. Thank you for looking into this. We really appreciate the ability to customize that section.

Best,

Jackie S.

jmsmit49
Community Participant

Hi Chris,

Thanks for adding my question to those other groups - I will check them out!

Best,

Jackie S. 

stuart_ryan
Community Coach
Community Coach

Hi  @jmsmit49 ,

Apologies for the delayed reply, that would align (if memory serves me correctly) with the changes that happened in Catalog around that time.


As custom JS is unsupported, this can often be difficult to track down, there may have been a security related change that could have caused this, I would recommend reaching out through your CSM to see if they are able to find any additional details out for you.

Kind Regards,
Stuart

View solution in original post

HI Stuart,

I'm having issues getting a custom JS to work on Catalog Homepage too and can seem to find an answer. Do you know if there is a solution to this or is there really no way to get this to work?