/** * Userxtd after display content method * * Method is called by the view and the results are imploded and displayed in a placeholder * * @param string $context The context of the content being passed to the plugin. * @param object $article The content object. Note $article->text is also available * @param object $params The content params * @param int $page The 'page' number * * @return string */ public function onContentAfterDisplay($context, $article, $params, $page = 0) { $result = ''; if ($this->params->get('UserInfo', 1)) { // Detect Context $option = $this->input->get('option'); $view = $this->input->get('view'); $layout = $this->input->get('layout', 'default'); if ($option == 'com_content' && $view == 'article' && $layout == 'default') { $this->initComponent(); $result .= \Userxtd\Content\UserInfo::createInfoBox($this->getContainer(), $article, $params); } } return $result; }
foreach ($data as $k => $v) { $this->{$k} = $v; } // Templates $app = JFactory::getApplication(); $layout = JPATH_THEMES . '/' . $app->getTemplate() . '/html/com_content/category/blog_item.php'; if (!is_file($layout)) { $layout = \Windwalker\Helper\PathHelper::getSite('com_content') . '/views/category/tmpl/blog_item.php'; } ?> <div class="row-fluid"> <div class="span12"> <?php $article = new stdClass(); $article->created_by = $data->user->id; echo \Userxtd\Content\UserInfo::createInfoBox(\Windwalker\DI\Container::getInstance('com_userxtd'), $article); ?> <?php foreach ($data->items as $item) { ?> <?php $this->item = $item; $this->item->readmore = true; $this->params->set('access-view', true); ?> <div class="article-content userxtd-content"> <?php include $layout; ?> </div>