Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media Types #5

Closed
SamDrummond opened this issue Mar 28, 2017 · 3 comments
Closed

Media Types #5

SamDrummond opened this issue Mar 28, 2017 · 3 comments

Comments

@SamDrummond
Copy link

I'm interested in building a custom media type... another option for adding a custom chart control in an immersive section. Am I able to do this. Do you have documentation for this?

@skitterm
Copy link
Contributor

skitterm commented Mar 29, 2017

Hi Sam,

Glad to hear you're interested in customizing Cascade! We don't have any documentation for adding a custom media type (our docs mainly describe how to download and self-host the application). Adding a new media type is possible, but fairly complex. The media types extend a common base class, but they often have their own behavior. What's more, these media types often act differently depending on where they are in the story (in the cover, in an immersive section background, or a narrative section block).

Off the top of my head, at minimum you would need to:

  1. Add a class for the new media item (like this)
  2. Give it a handlebars template for the immersive section background (like this)
  3. Add it to the "add media" menu

You can see how the pattern works with the webpage media type in these links. For the webpage.jsx code itself, render injects the handlebars template with the data, and postCreate is called after that template is in the DOM (so any DOM manipulation/3rd-party library code can go there).

If you can get away with adding the chart control to your Cascade as a webpage (instead of coding up a new media type), I'd do that. You could even have the Cascade app and the webpage "talk" to each other if you needed events.

@SamDrummond
Copy link
Author

Thanks so much @skitterm. Sorry this has taken me so long to reply. It will be a little longer before I get a chance to try your advice but will keep you in the loop on my progress.

@skitterm
Copy link
Contributor

@SamDrummond I'm going to close this ticket; let us know if you run into any further issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants