Wordpress Shortcode for content

Hi,

I've been using H5P in wordpress for a few months and its great. I use the embed code to show the content and its been fine.

However, I've recently come across another wordpress installation that I don't have control over and when I paste the embed code it strips out both the iframe and the script tags, meaning that I can't embed the content.

A way round this (and arguably better way) of embedding content in wordpress would be to provide a shortcode for each piece of content e.g. [hp5 content=123456] with additional parameters such as background colour perhaps etc.

Are there any plans to develop this shortcode? It would naturally appear in the main content table with a new column.

Let me know if not and I'll get something developed shortly.

Alex

 

falcon's picture

Hi Alex,

We actually already have short code support, and in vanilla Wordpress there is a button for adding it to the wysiwyg text editor. The short code looks like this [h5p id="123"]. We know that this feature is a bit well kept for some and will do things to make this feature less of a secret :) Unfortunately it doesn't accept other parameters yet.

Svein-Tore

 

Doh! I've just seen this button THANKS. A huge help - will add it to our training literature.

Alex

falcon's picture

:)

Hi I want to use he shortcode feature in 'Fill in the Blanks', if i copy the sortcode and paste into Text editor/text page, nothing happens. Also the button I can see does not function. I'm using Elementor page builder. Are they compatible?  Any help please?  Jonathan

BV52's picture

Hi Jonathan,

You need to use the "shortcode" option in under the "general" options in Elementor. 

-BV52

Hi Thanks for that.

I found the shortdcode option, but when I paste [h5p id="3"] into the sortcode widget nothing seems to happen?  Similar to pasting into text editor?  Any ideas?

 

BV52's picture

Hi Jonathan,

Once you save the page can you please check if you have any browser console errors.

-BV52

Thanks so much for this, it appears that when using shortcode in Elementor, even if the page is saved, the hp5 content is not visible until the page is previewed.

Strangely, even when a page is saved, when return to edit the page in Elementor, the pasted hp5 content is not visible - you need to refer to the live page for the content. Thank you for you help with this. 

 


I wondered if there is an option to remove the embed and h5p link at the bottom of content?

 

BV52's picture

Hi Jonathan,

You are right, when I was trying this out I immediately previewed the page prior to saving. I think Elementor and H5P is not fully compatible in this case but at least it shows up.

The download/embed/H5P buttons can be disable when you are editing the content, it can be found in the right hand portion under display options (screenshot 1). If this is not showing and if you are the administrator you just need to enable the display option or disable them all together by going to setting->H5P (screenshot 2).

-BV52

Thanks for that, starting to get the hang of this now.

Jonathan