1
votes

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>"
3
Just on a side note, you don't need to put a single table in an arrayLodder
If you can see the bullet points in the editor they must be stored in the DB, either in introtext or fulltext depending on if a readmore is in the article.Craig
That is exactly what I had thought, although I am pulling out of the database with the above query and the list markup is not there.bnp887
how do you output the introtext afterwards? Maybe you're loosing the markup only there...mb21
@wclear Are you still not sure of the answer? Save an article with intro text and full text (just a couple of sentences0 and then paste what you find in the database in your questions)?Elin

3 Answers

2
votes

If you don't put a "read more" break everything will be stored in introtext. If you put a read more then it will be split between introtext and fulltext. In other words, you only need fulltext if you are making that distinction. It's a little old fashioned, but that is the API from Joomla 1.0 which is pre JSON.

2
votes

The markup is stored in the introtext/fulltext columns, there is no other place where just the markup is stored (would be a terrible idea to split them up). Do a print_r($rows) to see it's all there.

If you do not see it in your output the problem will be in the way you display it. Can you tell us how you do that?

1
votes

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?