primo commit
This commit is contained in:
37
plugins/fields/articles/tmpl/articles.php
Normal file
37
plugins/fields/articles/tmpl/articles.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Articles Field
|
||||
* @version 4.3.2
|
||||
*
|
||||
* @author Peter van Westen <info@regularlabs.com>
|
||||
* @link https://regularlabs.com
|
||||
* @copyright Copyright © 2024 Regular Labs All Rights Reserved
|
||||
* @license GNU General Public License version 2 or later
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Layout\FileLayout as JLayoutFile;
|
||||
|
||||
if (empty($field->value))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$layout = new JLayoutFile('plg_fields_articles.articles');
|
||||
|
||||
$include_paths = $layout->getIncludePaths();
|
||||
$include_paths[] = JPATH_SITE . '/plugins/fields/articles/layouts';
|
||||
$layout->setIncludePaths($include_paths);
|
||||
|
||||
$layout_type = $field->fieldparams->get('layout', 'title');
|
||||
$value_layout = new JLayoutFile('plg_fields_articles.' . $layout_type);
|
||||
$value_layout->setIncludePaths($include_paths);
|
||||
|
||||
echo $layout->render([
|
||||
'context' => $context,
|
||||
'item' => $item,
|
||||
'field' => $field,
|
||||
'layout_type' => $layout_type,
|
||||
'layout' => $value_layout,
|
||||
]);
|
||||
Reference in New Issue
Block a user