I have a problem with two pieces of HTML which I would like to put in a block. One is for WebRing and the other is for Flag Counter ( http://www.flagcounter.com/index.html ). On one of the four sites I am running from the same 6.13 code base, there was a time early on, but some version of 6.x, when I had put this code:
[ img_assist|nid=41|title=|desc=|link=none|align=center|width=304|height=70]
< script type="text/javascript" src="http://ss.webring.com/navbar?f=j;y=tamhas;u=defurl">
< /script>
< center>Powered by < a href="http://dir.webring.com/rw" target=_top>WebRing< /a>®.< /center>
into a block which was designated to be always shown, but only on the node page. And, once upon a time I got the WebRing image and one could link to other sites in the ring to which I belong. At some point back around March it stopped working. Since it is only on the home page and I had put in in the Content Bottom area of a Pixture Reloaded theme, it wasn't something I actually saw very often, so I don't know how long it had been broken. The "Powered by WebRing bit shows, but not the img part above that. I've had other things to pay attention to, but eventually I would like to get this working again, since I have been dropped from the ring because the code is missing!
Today, I tried to do a similar thing on one of the other sites using the same theme, but for Flag Counter. Its code is:
< a href="http://s05.flagcounter.com/more/7Im">< img src="http://s05.flagcounter.com/count/7Im/bg=FFFFFF/txt=000000/border=CCCCCC/columns=3/maxflags=20/viewers=0/labels=1/" alt="free counters" border="0">< /a>
(Yes, I have stuck a couple extra spaces in to keep the code from being interpreted)
This also does nothing. If I put text in the same block, the text shows, but not the flag counter. I also tried it on a site using Giordani, which has no content bottom slot, so I put it in the footer, but with the same result.
Is it possible that HTML Purifier is knocking out this code? I read here http://drupal.org/node/217457 that "I just read a recent thread in the webrings.org managers' forum, in which the powers that be webring say they don't care about validating to w3c standards,..." which sounds like it might be a reason for a purge!
Anything to do about it?
Comments
Comment #1
ezyang commentedPlace whatever filter you're using to execute after HTML Purifier, and make sure whatever code activates the filter passes through HTML Purifier unharmed (square bracket stuff works well)
Comment #2
tamhas commentedI don't understand "filter you are using to execute". It is just HTML as shown in my original post. I also don't understand "square brackets stuff works well".
Comment #3
ezyang commentedI don't understand your current situation, but as far as I can tell:
- If before using HTML Purifier you allowed script tags, just don't bother with HTML Purifier at all
- If you have a plugin that's inserting script tags, make sure that plugin runs after HTML Purifier, and make sure HTML Purifier doesn't purify away what the plugin is looking for
Comment #4
tamhas commentedSorry to be lacking the right vocabulary, but ...
I don't know what script tags are and nothing was done to allow or disallow them. All I know is that the code for the WebRing was something I put in a block early on with this site and it worked when I did it, but now it doesn't.
I have no plugin that is inserting script tags to my knowledge, but then, since I don't know what they are, I don't know if I do or don't. Everything on these sites is using pretty plain vanilla markup except what the modules are doing unbeknownst to me under the skin. E.g., we use the pagination module on some of the sites and I assume it does some fancy stuff under the surface to break things up into pages and put a page bar at the bottom, but I don't know specifically what it is doing and haven't fiddled with it. Likewise footnotes on a couple of the sites.
Other than the module related markup, the HTML we have used is very basic so that only 1 out of 40 or 50 pages do we need to even go so far as to select Full HTML. Prior to this experiment with the Flag Counter, the only example of pasting in HTML provided by an outside source which did things like reference an external site was the WebRing code provided in my initial post.
So, I'm not clear what my choices are here. I can't move around the sequence in which plugins are applied since the code I showed you is just typed in to the node.
Is my choice to forgo HTML purifier in order to get WebRing and the Flag Counter (but to annoy the SEO module) or to forgo the WebRing and Flag Counter in favor of SEO heaven?
Comment #5
ezyang commentedThe simplest solution, if you trust the people who are typing in HTML, is just to do full HTML. A slightly more complex solution would be to define a block which contains this code, and then include it in the relevant page. Ask #drupal about how to do this. Alternatively, you could create a filter (inside HTML Purifier), but this requires some coding knowledge.
Comment #6
tamhas commentedThe only HTML I am interested in putting in is that cited in the original post and I'm the only one putting it in and yes, I am using Full HTML and yes, what I have done is to define a block with that code and specify node as the only page on which it appears. I.e., that is exactly what I have done.
Comment #7
ezyang commentedOk. I think you should punt HTML Purifier on that block (i.e. turn it off). It's unnecessary, introduces extra overhead, and doesn't even do what you want it to do.
Comment #8
tamhas commentedHow does one turn off HTML Purifier for a single block? I'd happily try that, but all I see is turning it off and on for a given input format. Are you suggesting I turn it off for anything that is Full HTML?
Any way to look at what is currently Full HTML?
Comment #9
ezyang commentedEasy! Make a new input format and have just that block use it.
Comment #10
xurizaemon@tamhas: As ezyang says, all you need to do is create your block with an input filter which does *not* have the htmlpurifier filter activated on it at all.
Generally this is what i'd make the Full HTML format (while Filtered HTML has the drupal HTML Filter replaced with HTML Purifier), and then i'd make sure that regular staff could only access the "Filtered HTML".
This should stop script tags & other such gremlins getting added to your pages while you aren't looking.
Comment #11
tamhas commentedOK, after a flu distraction, I got a chance to play with this tonight. Since we have very, very few entries using Full HTML, I decided to go that route instead of creating a new format. Disabling HTML Purifier was not sufficient, but that and HTML Corrector did the job. Both blocks now work as intended.
Thanks all!