Hi support, I installed the HTML Stripper plugin, version 1.0.1, author Paul Burdick from the ee 2.0 Beta-ZIP-package. When I use it in this code
{exp:channel:entries channel="blog" limit="5" orderby="date" sort="desc"}
<li><a href="http://{path=%22blog/artikel%22}" title="{exp:html_strip}{intro}{/exp:html_strip}">{title}</a></li>
{/exp:channel:entries}i get a blank page. The code above works fine without the html_strip. Nothing besides <body><html></html></body> gets rendered.
Even a
{exp:html_strip}This is text<b>{/exp:html_strip}leads to the same blank page. I would assume, that the output should be
This is textSo it has nothing to to with the channel entries tag.
If you need more info, just say so.
Thanks awa
Moved to Plugins by Moderator
Hi Sue, ah, ok. Thanks for the quick reply. But why is it then part of the “EllisLab ExpressionEngine 2.0 Public Beta add-ons”? I downloaded the ZIP and all the plugins within installed themselves properly (own folder under third_party-directory), so when I use the CP to access the plugin I see it and it looks, as if it´s ready to go. And the char_limit plugin which is also part of the package works fine.
So, what you are saying is, that not all plugins in the Beta add-ons are actually ported to 2.0? If yes, when do you think, the plugin will be 2.x?
Cheers awa
I just started my Expression Engine 1.x to 2.x transition, and hit the same problem. I was able to modify the old one to work with the new one…it’s a really short plugin.
Here’s the first 40 lines of old code of pi.html_strip.php:
<?php
/*
=====================================================
ExpressionEngine - by pMachine
-----------------------------------------------------
http://www.pmachine.com/
-----------------------------------------------------
Copyright (c) 2003 pMachine, Inc.
=====================================================
THIS IS COPYRIGHTED SOFTWARE
PLEASE READ THE LICENSE AGREEMENT
http://www.pmachine.com/license/
=====================================================
File: pi.html_strip.php
-----------------------------------------------------
Purpose: HTML stripper plugin
=====================================================
*/
$plugin_info = array(
'pi_name' => 'HTML Stripper',
'pi_version' => '1.0.1',
'pi_author' => 'Paul Burdick',
'pi_author_url' => 'http://www.pmachine.com/',
'pi_description' => 'Removes HTML code from text',
'pi_usage' => HTML_strip::usage()
);
class HTML_strip {
var $return_data;
// ----------------------------------------
// Character Limiter
// ----------------------------------------
function HTML_strip($str = '')
{
global $TMPL, $FNS;
$convert = ( ! $TMPL->fetch_param('convert')) ? 'n' : $TMPL->fetch_param('convert');
$convert_back = ( ! $TMPL->fetch_param('convert_back')) ? 'original': $TMPL->fetch_param('convert_back');
$keep = ( ! $TMPL->fetch_param('keep')) ? '' : $TMPL->fetch_param('keep');
$template = ($str == '') ? $TMPL->tagdata : $str;
$template = str_replace('/', '/',$template);. . . And below are the modified lines. It just converts from the old parameter setup style to the new style: . . .
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$plugin_info = array(
'pi_name' => 'HTML Stripper UNOFFICIAL EE 2.X CONVERSION',
'pi_version' => '1.0.1',
'pi_author' => 'Paul Burdick',
'pi_author_url' => 'http://expressionengine.com/',
'pi_description' => 'Removes HTML code from text',
'pi_usage' => HTML_strip::usage()
);
/**
* HTML_strip Class
*
* @package ExpressionEngine
* @category Plugin
* @author UNOFFICIAL EE2.X CONVERSION
* @copyright Copyright (c) 2004 - 2009, EllisLab, Inc.
* @link http://expressionengine.com/downloads/details/html_strip/
*/
class HTML_strip {
var $return_data;
// ----------------------------------------
// HTML Stripper
// ----------------------------------------
function HTML_strip($str = '')
{
$this->EE =& get_instance();
$convert = ( ! $this->EE->TMPL->fetch_param('convert')) ? 'n' : $this->EE->TMPL->fetch_param('convert');
$convert_back = ( ! $this->EE->TMPL->fetch_param('convert_back')) ? 'original': $this->EE->TMPL->fetch_param('convert_back');
$keep = ( ! $this->EE->TMPL->fetch_param('keep')) ? '' : $this->EE->TMPL->fetch_param('keep');
$template = ($str == '') ? $this->EE->TMPL->tagdata : $str;
$template = str_replace('/', '/',$template);. . . It APPEARS to work on my test installation. I hope this is OK to post here. I’ve changed the plugin info with the string “UNOFFICIAL EE 2.x CONVERSION” to remind myself that it’s something I should check later.
To complete the conversion, I created a folder called html_strip in my system/expressionengine/thirdparty/ folder and dropped the file in it.
I don’t know why I couldn’t use the two other “plugins” folders in system and system/expressionengine. Could some one tell me what the difference is?
Hi Greg,
Does David’s solution in thread help you out?
First: Thanks to David! I got it working, but I have trouble with the keep-Parameter. If I say keep=”p”, it keeps the p-tag, so after stripping i have a
, but with the
the < and the > are & lt;/a & gt; (I broke the entities to make it show up here) And this is not working. I tried a lot of combinations of convert and convert_back, but the closing tags like
</a>, </b>...are not working.
Cheers awa
Hello!
I am having a similar problem with HTML_STRIP
For example my code is:
{exp:char_limit total="45"}{exp:html_strip}{news_body}{/exp:html_strip}{/exp:char_limit}Yet this outputs an excerpt of 45 characters with the html still included…
Maybe this plugin can’t be used within the char_limit?
I’m currently using the plugin with EE v1.6.8
Thanks!
Hello! I am having a similar problem with HTML_STRIP For example my code is:Yet this outputs an excerpt of 45 characters with the html still included… Maybe this plugin can’t be used within the char_limit? I’m currently using the plugin with EE v1.6.8 Thanks!{exp:char_limit total="45"}{exp:html_strip}{news_body}{/exp:html_strip}{/exp:char_limit}
You might want to try adding parse=”inward”:
{exp:char_limit total="45" parse="inward"}that way the limit will be processed first then strip out the HTML.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.