Project

General

Profile

Support #12777

request to include custom javascript into a Commons-hosted site

Added by Marilyn Weber over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority name:
Normal
Assignee:
-
Category name:
-
Target version:
Start date:
2020-05-11
Due date:
% Done:

0%

Estimated time:

Description

Aucher Serr writes:

"Ellie (cc'd) and I are currently co-teaching the Interactive Data Visualization course at the Graduate Center and we were hoping to put together an engaging 'microsite' to host our students' final projects.

Ideally we would like to create a site that has the look and feel of an industry-level standalone site so that we can get our students traction in non-academic communities as well as within the CUNY community.

To do that, we wanted to inquire as to what would be the best way to include custom javascript into a Commons-hosted site. I did some research and saw that there were a few plugins that enable that (https://wordpress.org/plugins/insert-headers-and-footers/) , but none of them seem to be available as part of the Commons curated list.

Could you please advise as to what would be the best way to add custom javascript to a commons site?

Thanks for your help,
Aucher and Ellie"

History

#1 Updated by Boone Gorges over 1 year ago

  • Status changed from New to Reporter Feedback

Thanks for passing along the request.

For security reasons, we don't allow users to run custom JavaScript on Commons sites. We'll be unable to add a plugin like insert-headers-and-footers that lets users skirt this restriction.

There may be other ways in which the Commons team could support the sharing of this student work. In the past, we've worked with users to develop custom embed codes, so that custom applications can be hosted elsewhere and then embedded via iframe into Commons sites. This is made easier if student work is built and shared on the same platform. For this reason, it'd be helpful to have a sense of how many projects we're talking about, and the specific technologies/tools that are being used to develop them.

#2 Updated by Matt Gold over 1 year ago

Hi Boone -- here is the site these faculty wound up creating for their students: https://interactivedatavis.github.io/student-project-microsite/dist/

Is it possible for us to provide a way for them to use an iframe to incorporate that site into a CAC website?

It's not absolutely necessary that we do that, so if it's not possible, it's okay

#3 Updated by Boone Gorges over 1 year ago

  • Status changed from Reporter Feedback to Staged for Production Release
  • Target version set to 1.16.14

Yes, we can do that - the fact that it's a single site makes it fairly easy.

https://github.com/cuny-academic-commons/cac/commit/7bb0f1c23614708cb4e01915abddf9852319b32d

I've implemented a shortcode [interactive-data-vis-microsites]. By default, it shows an iframe with width="100%" and height="480", but you can pass new arguments into the shortcode, to experiment with what looks best on your theme:

[interactive-data-vis-microsites height="800"]

#4 Updated by Matt Gold over 1 year ago

Hi Boone -- thanks so much. If there is any chance that you might be willing to add this as a hotfix ahead of next Tuesday's release, I would appreciate it.

#5 Updated by Boone Gorges over 1 year ago

  • Status changed from Staged for Production Release to Resolved

That sounds fine. I've pushed the changes to the production site.

#6 Updated by Matt Gold over 1 year ago

Thank you so much, Boone!! Much appreciated

Also available in: Atom PDF