Save HTML Title in Joomla
0 ResponseWRITTEN BY BATOO ON Jan/15/09 [2843]
Google! Digg! Permalink

I spent a lot of time to figure out how to save HTML Tags for title in Joomla.
When you try to save new content, Joomla try to check some fields are empty or not.

When Joomla check the field (eg: title and title alias), it convert html to plain text.

To save html taged title, just simply add 'title' as an ignore list as below.

/includes/joomla.php

    function check() {
        // filter malicious code
        $ignoreList = array( 'title', 'summary', 'introtext', 'fulltext' );
        $this->filter( $ignoreList );
        /*
        TODO: This filter is too rigorous,
        need to implement more configurable solution
        // specific filters
        $iFilter = new InputFilter( null, null, 1, 1 );
        $this->introtext = trim( $iFilter->process( $this->introtext ) );
        $this->fulltext =  trim( $iFilter->process( $this->fulltext ) );
        */

        if (trim( str_replace( ' ', '', $this->fulltext ) ) == '') {
            $this->fulltext = '';
        }
        if (trim( str_replace( ' ', '', $this->summary ) ) == '') {
            $this->summary = '';
        }       
        return true;
    }

Leave a Reply