Need updated code for Joomla 5 for template override.
Posted: 28 Mar 2024, 08:18
I almost have this plug-in working with a 3rd party template (Helix Framework Ultimate), but when clicking the button, I'm getting the error "Failed to load PDF document."
I have the component, content plugin, system plugin, and all the fonts installed and activated.
The example code on the site is for older Joomla with icons.php, which no longer exists. We need a code example for Joomla 4/5 to get this working.
Here's the code I have in com_content/article/default.php
This is a popular template that is used by a lot of Joomla websites. Being compatible would make a lot of developers' lives easier.
I have the component, content plugin, system plugin, and all the fonts installed and activated.
The example code on the site is for older Joomla with icons.php, which no longer exists. We need a code example for Joomla 4/5 to get this working.
Here's the code I have in com_content/article/default.php
Code: Select all
<?php if ($params->get('show_title') || $params->get('show_author')) : ?>
<div class="article-header">
<?php if ($params->get('show_title')) : ?>
<?php $phocaPDF = false;
if (JPluginHelper::isEnabled('phocapdf', 'content')) {
include_once(JPATH_ADMINISTRATOR.'/components/com_phocapdf/helpers/phocapdf.php');
$phocaPDF = PhocaPDFHelper::getPhocaPDFContentIcon($displayData['item'], $displayData['params']);
}
?>
<?php echo $phocaPDF; ?>
<<?php echo $page_header_tag; ?> itemprop="headline">
<?php echo $this->escape($this->item->title); ?>
</<?php echo $page_header_tag; ?>>
<?php endif; ?>