Labels |
Added:
No Code Attached Yet
|
What could possibly be the issue here? I have loaded through a custom layout override the following code to debug.
<?php // Force the use of created_by_alias if it exists, or fallback to author $this->item->author = !empty($this->item->created_by_alias) ? $this->item->created_by_alias : $this->item->author; echo 'Debug Author Alias: ' . $this->item->author; ?>
Other steps I have tried are checking the database direct, clearing the cache, all to no resulkt.
Have a look t how core joomla does this. The code is in layouts\joomla\content\info_block\author.php
@brianteeman yes, that is where I copied the override from. It looks working there but just doesnt render the output the same way. So cannot find anything odd in the database or the core / overrides.
As a background it is a site migrated from J3 to J4. I added a new article into the system and it brings the same result. The alias is not loaded.
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
?>
<dd class="createdby" itemprop="author" itemscope itemtype="https://schema.org/Person">
<span class="icon-user icon-fw" aria-hidden="true"></span>
<?php $author = ($displayData['item']->created_by_alias ?: $displayData['item']->author); ?>
<?php $author = '<span itemprop="name">' . $author . '</span>'; ?>
<?php if (!empty($displayData['item']->contact_link) && $displayData['params']->get('link_author') == true) : ?>
<?php echo Text::sprintf('COM_CONTENT_WRITTEN_BY', HTMLHelper::_('link', $displayData['item']->contact_link, $author, ['itemprop' => 'url'])); ?>
<?php else : ?>
<?php echo Text::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
<?php endif; ?>
</dd>
without seeing the rest of your template, overrides etc its not possible to comment further. Even with that information this is not the place to fix the code in your template.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-10-30 14:50:59 |
Closed_By | ⇒ | Quy |
Please submit to Joomla forum for support. https://forum.joomla.org/
@brianteeman agreed, even with any of the overrides disabled it still isnt working out of the box. Thought it might be a bug in the core hence my post here. I will check whether the current site template has issues.
Can't confirm: