store a literal iframe as a field

[ad_1]

(ok I was able to solve myself – I will leave this here for anyone else that wants to do this)

Hi,

I’m embedding an audio player in a page, however the oEmbed type does not support the hosting platform I am using – Disco

Disco allows me to create a player for a given track, it gives me an frame for that specific track, and the frame has an id and key which must match, or the player will not function. For every track I want to embed, I will need to export this iframe from disco. If I change a single option (e.g. turn off downloading) the id and key will change.

I’ve been able to embed the player by putting most of the iframe into the template, and only storing the id and key in fields. However this will be very brittle in use, as I have to manually get the id and key from the exported iframe.

What I would really like to do is simple store the whole iframe in the field (a single copy/paste) and output it into the template as html. However I cannot find a way to do that. I thought that the HTML field type was going to help me, but that doesn’t work in that way (it doesn’t store any data on a per-instance basis, it turns out).

I’ve also tried entering the iframe into a text field which is configured to allow html tags but that also didn’t work. The content of the field seems to be silentyly discarded somewhere.

How can I best solve this?

(OK I solved it)

I used a plain text field, upped the length to 512, and enabled the iframe tag. I was a bit confused because I read in teh docs that if the tag list was left empty ALL tags would be allowed but in fact when I tried that it didn’t seem to work. However, explicitly enabing iframe did work just fine.

pods is very very nice! thank you kind people!

  • This topic was modified 23 minutes ago by danmcb.
  • This topic was modified 4 minutes ago by danmcb.

The page I need help with: [log in to see the link]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer