Search code examples
phpdatabasejoomlajoomla3.0

Where does Joomla store 'fulltext' of articles?


Where does Joomla (3.3) store the 'fulltext' of articles? When I select all ("*") from the Joomla content table:

private function selectAllContent() {
    $query = $db->getQuery(true);
    $query->select("*");
    $query->from($db->quoteName(array('#__contents')));
    $rows = $db->loadRowList();
    // ...
}

I find that the fulltext column is empty and the introtext column has a version of article text which has had some html markup removed, e.g. bullet lists. In Joomla admin, it is still possible to open the 'edit article' screen where the bullet point list markup is present. Where is it stored in the database?

I know there is a related question: where are articles stored in joomla? however, the answer for that question just says that the content table is where the article is stored, which does not quite address my problem. Many thanks if you can help out!

Update

I am still lost, so providing all the code and the process that results in 'lost' markup. I've used print_r to see everything being returned.

  1. First, I create an article with a list, so the markup looks like:

    Introductory example text

    1. Some item plus more text here
    2. Another item plus more text here

  2. The article is saved.
  3. A module pulls all the articles (and all their content) from the database. The module code looks like this:

    // From the main module file:
    $helper = new modArticlesTableHelper;
    $articlesTable = $helper->getArticleContent($params);
    
    // From the module helper file:
    public function getArticleContent($params) {
        $result = $this->_getArticles();
        return "<div style=\"display:none;\">".print_r($result, true)."</div>";
    }
    
    private function _getArticles() {
        $db = JFactory::getDbo();
        $query = $db->getQuery(true);
        $query->select("*");
        $query->from($db->quoteName(array('#__contents')));
        $query->where($db->quoteName('catid')." = 16");
        $rows = $db->loadObj();
        return $rows;
    }
    
  4. The result of which is simply echoed in the module template:

    echo $articlesTable;
    
  5. If I then copy the markup that gets output by the module from the page displaying it, only this comes through:

    ["introtext"]=&gt;
    string(127) "Introductory example text 
    
    <strong>Some item</strong> plus more text here
    <strong>Another item</strong> plus more text here"
    ["fulltext"]=&gt;
    string(0) ""
    
  6. So far, I don't see how a filter comes into play - it looks like it goes pretty directly from the database into print_r. However, when I then go to edit the article again, the markup remains:

Introductory example text

  1. Some item plus more text here
  2. Another item plus more text here

Is it possible a filter stripped the list at some point here?

Update 2

If I add a Readmore break to the top of the joomla article, the following is returned, however, I don't believe that adding a readmore break to the top of each article is the correct way to go - seems like a hack!

["introtext"]=>
string(0) ""
["fulltext"]=>
string(164) "
<p>Introductory example text</p>
<ol>
<li><strong>Some item</strong> plus more text here</li>
<li><strong>Another item</strong> plus more text here</li>
</ol>"

Solution

  • Looking at the exmaple database included with the Joomla 3.3 download, there is this entry for the #__content table (showing only a part of the introtext column):

    <p>Here are some basic tips for working on your site.</p>\r\n<ul>\r\n<li>Joomla! has a "fr ... ge.</li>\r\n</ul>, 
    

    It contains the unordered list <ul><li>, and there is no other place in the SQL dump where the html markup for unordered lists can be found.

    So the question is, on what facts are you basing your conclusion that:

    the introtext column has a version of article text which has had some html markup removed, e.g. bullet lists.

    For example: are you using any filtering functions when displaying the content?