Skip to main content
added 6 characters in body
Source Link
FFrewin
  • 19.8k
  • 10
  • 48
  • 101

I have no idea about how you build your module and what the $item stands for there.

Assuming you are loading the articles using the com_content's model and you have an array of $items$items with each $item$item being an Article ObjectArticle Object, returned by the ContentModel, then you can do at the top of your module's template:

$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('content');

Then in your loop of the $items (since you said you are porting over a category blog, I guess you will have a list of articles).

foreach ($items as $item) {

    // Get everything from the enabled OnContentBefore plugins in an array
    // passing the $item and $params as reference
    $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content.article', &$item, &$item->params, 0)); 
    
    $beforeDisplayContent = trim(implode("\n", $results));

    echo $beforeDisplayContent . ' - ' . $item->title;

}

##More reading: JPlugin Documentation:

I have no idea about how you build your module and what the $item stands for there.

Assuming you are loading the articles using the com_content's model and you have an array of $items with each $item being an Article Object, returned by the ContentModel, then you can do at the top of your module's template:

$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('content');

Then in your loop of the $items (since you said you are porting over a category blog, I guess you will have a list of articles).

foreach ($items as $item) {

    // Get everything from the enabled OnContentBefore plugins in an array
    // passing the $item and $params as reference
    $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content.article', &$item, &$item->params, 0)); 
    
    $beforeDisplayContent = trim(implode("\n", $results));

    echo $beforeDisplayContent . ' - ' . $item->title;

}

##More reading: JPlugin Documentation:

I have no idea about how you build your module and what the $item stands for there.

Assuming you are loading the articles using the com_content's model and you have an array of $items with each $item being an Article Object, returned by the ContentModel, then you can do at the top of your module's template:

$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('content');

Then in your loop of the $items (since you said you are porting over a category blog, I guess you will have a list of articles).

foreach ($items as $item) {

    // Get everything from the enabled OnContentBefore plugins in an array
    // passing the $item and $params as reference
    $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content.article', &$item, &$item->params, 0)); 
    
    $beforeDisplayContent = trim(implode("\n", $results));

    echo $beforeDisplayContent . ' - ' . $item->title;

}

##More reading: JPlugin Documentation:

added 261 characters in body
Source Link
FFrewin
  • 19.8k
  • 10
  • 48
  • 101

I have no idea about how you build your module and what the $item stands for there.

Assuming you are loading the articles using the com_content's model and you have an array of $items with each $item being an Article Object, returned by the ContentModel, then you can do at the top of your module's template:

$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('content');

Then in your loop of the $items (since you said you are porting over a category blog, I guess you will have a list of articles).

foreach ($items as $item) {

    // Get everything from the enabled OnContentBefore plugins in an array
    // passing the $item and $params as reference
    $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content.article', &$item, &$item->params, 0)); 
    
    $beforeDisplayContent = trim(implode("\n", $results));

    echo $beforeDisplayContent . ' - ' . $item->title;

}

##More reading: JPlugin Documentation:

I have no idea about how you build your module and what the $item stands for there.

Assuming you are loading the articles using the com_content's model and you have an array of $items with each $item being an Article Object, returned by the ContentModel, then you can do at the top of your module's template:

$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('content');

Then in your loop of the $items (since you said you are porting over a category blog, I guess you will have a list of articles).

foreach ($items as $item) {

    // Get everything from the enabled OnContentBefore plugins in an array
    // passing the $item and $params as reference
    $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content.article', &$item, &$item->params, 0)); 
    
    $beforeDisplayContent = trim(implode("\n", $results));

    echo $beforeDisplayContent . ' - ' . $item->title;

}

I have no idea about how you build your module and what the $item stands for there.

Assuming you are loading the articles using the com_content's model and you have an array of $items with each $item being an Article Object, returned by the ContentModel, then you can do at the top of your module's template:

$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('content');

Then in your loop of the $items (since you said you are porting over a category blog, I guess you will have a list of articles).

foreach ($items as $item) {

    // Get everything from the enabled OnContentBefore plugins in an array
    // passing the $item and $params as reference
    $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content.article', &$item, &$item->params, 0)); 
    
    $beforeDisplayContent = trim(implode("\n", $results));

    echo $beforeDisplayContent . ' - ' . $item->title;

}

##More reading: JPlugin Documentation:

added 51 characters in body
Source Link
FFrewin
  • 19.8k
  • 10
  • 48
  • 101

I have no idea about how you build your module and what the $item stands for there. Assuming

Assuming you are loading the articles using the com_content's model and you have an array of $items with each $item isbeing an Article ObjectArticle Object, returned by the ContentModel, then you can do at the top of your module's template:

$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('content');

Then in your loop of the $items (since you said you are porting over a category blog, I guess you will have a list of articles).

foreach ($items as $item) {

    // Get everything from the enabled OnContentBefore plugins in an array
    // passing the $item and $params as reference
    $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content.article', &$item, &$item->params, 0)); 
    
    $beforeDisplayContent = trim(implode("\n", $results));

    echo $beforeDisplayContent . ' - ' . $item->title;

}

I have no idea about how you build your module and what the $item stands for there. Assuming you are loading the articles using the com_content's model and $item is an Article Object, returned by the ContentModel, then you can do at the top of your module's template:

$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('content');

Then in your loop of the $items (since you said you are porting over a category blog, I guess you will have a list of articles).

foreach ($items as $item) {

    // Get everything from the enabled OnContentBefore plugins in an array
    // passing the $item and $params as reference
    $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content.article', &$item, &$item->params, 0)); 
    
    $beforeDisplayContent = trim(implode("\n", $results));

    echo $beforeDisplayContent . ' - ' . $item->title;

}

I have no idea about how you build your module and what the $item stands for there.

Assuming you are loading the articles using the com_content's model and you have an array of $items with each $item being an Article Object, returned by the ContentModel, then you can do at the top of your module's template:

$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('content');

Then in your loop of the $items (since you said you are porting over a category blog, I guess you will have a list of articles).

foreach ($items as $item) {

    // Get everything from the enabled OnContentBefore plugins in an array
    // passing the $item and $params as reference
    $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content.article', &$item, &$item->params, 0)); 
    
    $beforeDisplayContent = trim(implode("\n", $results));

    echo $beforeDisplayContent . ' - ' . $item->title;

}
Source Link
FFrewin
  • 19.8k
  • 10
  • 48
  • 101
Loading