<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="2.0">
    <channel>
        <title>Clean_the_html_for_the_export[ Search for &quot;&quot;]</title>
        <description></description>
        <link>http://xataface.com/wiki/index.php?-action=single_record_search&amp;-table=wiki&amp;page_id=%3D178&amp;-cursor=0&amp;-skip=0&amp;-limit=30&amp;-mode=list&amp;--subsearch=</link>
        <lastBuildDate>Thu, 20 Jun 2013 01:01:13 +0100</lastBuildDate>
        <generator>FeedCreator 1.7.2</generator>
        <item>
            <title>Clean_the_html_for_the_export</title>
            <link>http://www.xataface.com/wiki/Clean_the_html_for_the_export</link>
            <description>&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Field&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Page name&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;Clean_the_html_for_the_export&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Page id&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;178&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Page title&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;Clean the HTML to export data&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Content&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;
&lt;h2 id=&quot;toc0&quot;&gt;Clean HTML tags and entities to export your data&lt;/h2&gt;
 &lt;ol&gt;
    &lt;li&gt;Override the display() of the field to strip the tags... but this would affect all parts of the application where the HTML fields are displayed.&lt;/li&gt;
    &lt;li&gt;Create a grafted field, then override its display to show the stripped contents of the HTML area field.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;e.g. in the fields.ini:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt; 
    __sql__ = &amp;quot;select t.*, null as stripped_field from mytable t&amp;quot;
    [original_field]
       widget:type=htmlarea
       visibility:csv=hidden

    [stripped_field]
        visibility:csv = visible
        visibility:list=hidden
        visibility:browse=hidden
        visibility:find=hidden
&lt;/code&gt;&lt;/pre&gt;

 &lt;p&gt;Then in the delegate class:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt; 
    function stripped_field__display($record){
        return html_entity_decode(strip_tags($record-&amp;gt;val('original_field')), ENT_QUOTES, 'UTF-8');
    }&lt;/code&gt;&lt;/pre&gt;

 &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Language&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;en&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</description>
            <author>Clean_the_html_for_the_export</author>
        </item>
    </channel>
</rss>
