Need help with custom template code

Phoca PDF - creating PDF documents in Joomla! CMS
gscheiman
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 18 May 2012, 23:04

Need help with custom template code

Post by gscheiman »

Apologies if this is a duplicate post, my first attempt generated a message (error?) that flashed by too fast for me to see it.

I am trying to install the Phoca PDF module but I am using a template from cloudaccess.net which is based on Gentry/RocketTheme and therefore has custom components. Is there any chance someone can help me modify the code to fit the custom stuff revised? I've copy/pasted the custom code below. Any help would be appreciated.

From my template's com_content default.php:

Code: Select all

<?php
/**
 * @package   Template Overrides - RocketTheme
 * @version   3.2.5 June 1, 2011
 * @author    RocketTheme http://www.rockettheme.com
 * @copyright Copyright (C) 2007 - 2011 RocketTheme, LLC
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 *
 * Rockettheme Gantry Template uses the Joomla Framework (http://www.joomla.org), a GNU/GPLv2 content management system
 *
 */

// no direct access
defined('_JEXEC') or die;

JHtml::addIncludePath(JPATH_COMPONENT.DS.'helpers');

// Create shortcuts to some parameters.
$params		= $this->item->params;
$canEdit	= $this->item->params->get('access-edit');
$user		= JFactory::getUser();
?>
<div class="rt-article"><div class="rt-article-bg">
	<div class="item-page<?php echo $this->pageclass_sfx?>">
		<?php /** Begin Page Title **/ if ($this->params->get('show_page_heading', 1)) : ?>
		<h1 class="title">
			<?php echo $this->escape($this->params->get('page_heading')); ?>
		</h1>
		<?php /** End Page Title **/  endif; ?>
		<?php /** Begin Article Title **/ if ($params->get('show_title')) : ?>
		<h2 class="title">
			<?php if ($params->get('link_titles') && !empty($this->item->readmore_link)) : ?>
			<a href="<?php echo $this->item->readmore_link; ?>">
				<?php echo $this->escape($this->item->title); ?></a>
			<?php else : ?>
				<?php echo $this->escape($this->item->title); ?>
			<?php endif; ?>
		</h2>
		<?php /** End Article Title **/ endif; ?>

		<?php /** Begin Article Icons **/ if ($canEdit ||  $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
			<div class="rt-article-icons">
				<ul class="actions">
				<?php if (!$this->print) : ?>
					<?php if ($params->get('show_print_icon')) : ?>
					<li class="print-icon">
						<?php echo JHtml::_('icon.print_popup',  $this->item, $params); ?>
					</li>
					<?php endif; ?>

					<?php if ($params->get('show_email_icon')) : ?>
					<li class="email-icon">
						<?php echo JHtml::_('icon.email',  $this->item, $params); ?>
					</li>
					<?php endif; ?>
				
					<?php if ($canEdit) : ?>
					<li class="edit-icon">
						<?php echo JHtml::_('icon.edit', $this->item, $params); ?>
					</li>
					<?php endif; ?>
					<?php else : ?>
					<li>
						<?php echo JHtml::_('icon.print_screen',  $this->item, $params); ?>
					</li>
				<?php endif; ?>
				</ul>
			</div>
		<?php /** End Article Icons **/ endif; ?>
gscheiman
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 18 May 2012, 23:04

Re: Need help with custom template code

Post by gscheiman »

Okay, nearly resolved this.

1. Looking at the code, it is in two parts. The first php call just needs to go near the top of the default.php file. So I put it after my first statement (which renames some calls).

2. Second part of the code was trickier. I looked at each individual call and realized that I could map it to existing statements to make them work. After I figured this out, I found this in the forum which gives more details: viewtopic.php?f=37&t=13021

3. MUST set article options on BOTH article and menu to "show intro text". Otherwise, the PDF will be blank.

I'm down to one last issue:

The icon is just a duplicate of the print icon. How do I get it to look like a PDF icon? The alt tag is correct, so it's just the image that is the problem. And oddly enough, if I press the button to print, it will show the correct PDF icon in the print file. So it's just not showing right on the article page. See example here: http://paulushook.net/joomla/jupgrade/aboutus/bylaws
gscheiman
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 18 May 2012, 23:04

Re: Need help with custom template code

Post by gscheiman »

Solved. This post had the answer I needed to fix the PDF icon. viewtopic.php?f=37&t=14757

Note that the code suggests putting a double slash in commenting on the Joomla CSS, but mine required a single slash.

There are enough questions about Gantry frameworks that the two posts I linked to might be worth cleaning up and adding to the install guides to help folks out before they have to hunt around the forum for answers.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Need help with custom template code

Post by Jan »

Hi, I have no problem to add such information somewhere into guide, but I don't know the Gantry, so if somebody who knows these problems will write a guide for this, I will appreciate it and will add it to the Phoca PDF guide.

Jan
If you find Phoca extensions useful, please support the project
Post Reply