1 chenant Mar 29, 2005 16:54
3 chenant Mar 31, 2005 00:23
can you explain your recommendation on _formatting.php under conf/? you mentioned I should add the tag and attribute. how do I do that (I'm pretty clueless)
I don't know if this is transitional or transitional only (I don't even know what transitional means)
FYI - The amazon html goes like this...
<iframe src="http://rcm.amazon.com/e/cm?t=wwwhospitalim-20&o=1&p=8&l=as1&asins=0974998605&fc1=000000&=1&lc1=0000ff&bc1=000000<1=_blank&IS2=1&f=ifr&bg1=ffffff&f=ifr"
width="120"
height="240"
scrolling="no"
marginwidth="0"
marginheight="0"
frameborder="0">
</iframe>
4 stk Mar 31, 2005 06:00
Well, let's see ..
Usually, what I do, is add the code to the blog entry I want. Get the b2evo unsupported tag error, then say, "Yuck".
1) I first turn off HTML-checker, re-save my entry, and check to make certain that the code is working and isn't offensive to browsers everywhere.
2) Turn the HTML-checker back on.
(The html-checker is a line in the _formatting.php file that toggles the functionality of that file ON and OFF. It's at the top of the file. Look around line 42
$use_html_checker = 1;
1=ON, 0=OFF
Make sure to turn it back on or horrible things might happen while it is off (like people can write nasty javascript in your comments that can crash your site). 8|
3) Provided that the code is cool for browsers and I experience no other problems, I then edit the _formatting.php file, to add the tag (in your case "iframe").
4) Around line 110 of the _formatting.php file, you should see:
// Array showing what tags are allowed and what their allowed subtags are.
$allowed_tags = array
Add it anywhere below this point, but before the closing parentheses. Not sure entirely what the E_[crap] is, but assume that it defines an "Entity" and since Iframe is a block element, I would think that it should look like:
'iframe' --> E_block,
You don't have any sub-tags, so don't worry about those.
5) Adding the tag isn't enough, you must also add whatever attributes the checker might find within the tag (in your case, "width, height, scrolling, marginwidth, marginheight, and frameborder"). To do this, around line 188 and you should see
// Array showing allowed attributes for tags
$allowed_attribues = array
(
This is the beginning of where you can add those. Again, just follow the format for the other stuff. Yours will look like:
'iframe' --> A_attrs.' width height scrolling marginwidth marginheight frameborder ', // Transitional
That should be it.
Note: You may still have problems with the URL. Probably not, because it starts with http://, but it does contain a bunch of other stuff. IF you DO have a problem, bend over and kiss your butt goodbye, because I haven't been able to tame _formatting.php in this area and, apparently, neither has anyone else: http://forums.b2evolution.net/viewtopic.php?t=3393
Also: You said
(I'm pretty clueless)
. Maybe this will help.
1) Anything you see in a php file after a // is a COMMENT
2) Transitional refers to the DTD (Document Type Declaration), which, on well-formed pages, should be the first line of your code. b2evo is written to XHTML standards (the 'new' HTML) and it has a few flavors - Strict (the most stringent), Transitional (allows more tags from the 'old' html) and Frames (which, as you might expect, allows support for frames).
Many of the lines in the _formatting.php file are commented out ... because there's support for the two flavors - strict and transitional.
For, example ... only Frames and Transitional even support the iframe tag. It is deprecated in Strict, meaning that it is no longer supported.
Anyway ... so much for the lesson. Do the deed and let me know how you fare. (My site is strict, so I don't have an iframe, nor do I want one, so I can't really test this for you, but YOU CAN!) 8|
Go for it. :D
5 jonnypage May 16, 2005 17:50
Thanks for the info, however I tried this, and I get a
Tag iframe must occur inside another tag
error, any ideas about what to do here?
oh, and I had to turn --> to = > (sans space)
6 stk May 16, 2005 17:58
The quick answer would be to put the <iframe> tag into another tag ...
Try <div><iframe> .... </iframe></div>
(You'll need to add <iframe> as a legal subtag for <div> in _formatting.php.)
I don't have an iframe on my page, so I'm kinda flying blind here ... but it seems to me that's what it's asking for.
Hope this helps.
-stk
PS ... Yeah, sorry about the -->, but if you don't turn smilies off here, the => gets turned into a ... well, you know that already! ;)
7 jonnypage May 16, 2005 19:32
thanks for the quick responce, I'll give that a try!
8 lpfweb Jul 11, 2005 06:04
I am trying to do exactly the same thing. To get it to work without putting "iframe" in another tag, you have to add it to one of the lists of defined tags. I added it at line 66 of _formatting.php after the img tag. These are all the changes I made to get Amazon iframe links to work.
// At line 66 in my version of _formatting.php
define('E_special_extra', 'img iframe' );
// changes to arrays that were mentioned before...
$allowed_tags = array(
'iframe' => E_block,
//.......
$allowed_attribues = array(
'iframe' => A_attrs.' src width height scrolling marginwidth marginheight frameborder ', // Transitional
Maybe there's a better place for it - I am Brand New to b2evo. If there is a more "official" place to add a dangerous tag like iframe then I hope someone will let me know.
It would also be nice to be able to allow such tags on a per-blog basis. I won't request that until I'm a developer here!
9 zarmattathustra Oct 19, 2005 05:37
I got a "Tag iframe is not allowed within tag div," when I tried to do this. How do I fix this?
add the iframe tag and attributes to the /conf/_formatting.php file, so it is no longer considered "illegal".
Use the other tags and attributes as a guide for HOW they should be added.
OR ... turn off the HTML checker (in that same file) by flipping from 1 to 0, save your post, then turn the HTML checker back on.
-Scott :)