Follow

Can I use JuxtaposeJS on Wordpress?

If your site is hosted on Wordpress.com, unfortunately, the answer is no.

If your site is a privately hosted Wordpress site, then the answer is yes, if you are the administrator or have the cooperation of the administrator.

WordPress strips certain HTML markup out of posts for users in the 'author' and 'contributor' role. Technically, if a post is only ever edited by a user with the 'administrator' role, then there is no special step to take to use Wordpress -- but this leaves the risk that a less-privileged user will edit something else about the post and the JuxtaposeJS embed will be stripped.

The simplest solution is to install the iframe shortcode plugin and then adjust your markup to suit. For example, this embed code from the "share" pane:

<iframe class="juxtapose" width="640" height="360" src="https://cdn.knightlab.com/libs/juxtapose/latest/embed/index.html?uid=87ea6604-4812-11e5-b8ac-0e7075bba956"></iframe>

 would be changed to

[iframe class="juxtapose" width="640" height="360" src="https://cdn.knightlab.com/libs/juxtapose/latest/embed/index.html?uid=87ea6604-4812-11e5-b8ac-0e7075bba956"]

Again: you must install the iframe shortcode plugin for this to work.

Alternatively, the site administrator can adjust roles and capabilities so that people can add iframe tags. In more technical detail: each Wordpress user has a role and those roles are defined as a list of "capabilities." Only users with the unfiltered_html capability can include the <iframe> tag in their posts. For other users, it will be stripped out. Also, if a user without the unfiltered_html capability edits a post after the code is inserted, it will be stripped out. 

We recommend installing the iframe plugin as a simpler and generally more secure solution to the problem.

Update: Federico Cingolani has created a Wordpress plugin for Juxtapose. We have not tested it, but it may be useful to Wordpress users.

 

 

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk