Skip to content

Commit

Permalink
Prepare also the intro text
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Jul 19, 2017
1 parent f002c0b commit 1493c9e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions components/com_content/views/article/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,25 @@ public function display($tpl = null)
JPluginHelper::importPlugin('content');
$dispatcher->trigger('onContentPrepare', array ('com_content.article', &$item, &$item->params, $offset));

// Check if the intro text needs to be processed as well
if ($item->introtext && strpos($item->text, $item->introtext) !== 0)
{
// Save the old text of the article
$text = $item->text;

// Set the intro text as new text
$item->text = $item->introtext;

// Trigger the event with the introtext
$dispatcher->trigger('onContentPrepare', array ('com_content.article', &$item, &$item->params, $offset));

// Set the prepared intro text back
$item->introtext = $item->text;

// Restore the original text variable
$item->text = $text;
}

$item->event = new stdClass;
$results = $dispatcher->trigger('onContentAfterTitle', array('com_content.article', &$item, &$item->params, $offset));
$item->event->afterDisplayTitle = trim(implode("\n", $results));
Expand Down

0 comments on commit 1493c9e

Please sign in to comment.