Skip to content

Commit

Permalink
Prepare also the intro text (#17175)
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo authored and Michael Babker committed Aug 20, 2017
1 parent 691e472 commit 605a2f1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions components/com_content/views/article/view.html.php
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 605a2f1

Please sign in to comment.