No PDF icon with yootheme template

Phoca PDF - creating PDF documents in Joomla! CMS
koppie7
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 27 Jul 2010, 20:43

No PDF icon with yootheme template

Post by koppie7 »

Hi,

I'm using Joomla 1.6.3 and installed (FULL install) com_phocapdf_v2.0.0_rc2.zip
After that I installed and plg_phocapdf_content_v2.0.2.zip and activated it.
But there's no PDF icon shown when I'm using a yootheme template.
With the standard template Atomic of Joomla 1.6 the icon is shown.

I read about the modification I probably should make in the following files
components/com_content/views/article/tmpl/default.php
components/com_content/views/category/tmpl/blog_item.php
components/com_content/views/featured/tmpl/default_item.php


But I'm not a PHP-expert and therefore a bit confused because my template files are different from the examples on your site. :idea:

1. default.php is like this so where do I have to make the modification

Code: Select all

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 id="system" class="<?php $this->pageclass_sfx; ?>">

	<?php if ($this->params->get('show_page_heading', 1)) : ?>
	<h1 class="title"><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
	<?php endif; ?>

	<div class="item">

		<?php if (!$this->print) : ?>
			<?php if ($params->get('show_email_icon')) : ?>
			<div class="icon email"><?php echo JHtml::_('icon.email',  $this->item, $params); ?></div>
			<?php endif; ?>
		
			<?php if ($params->get('show_print_icon')) : ?>
			<div class="icon print"><?php echo JHtml::_('icon.print_popup',  $this->item, $params); ?></div>
			<?php endif; ?>
		<?php else : ?>
			<div class="icon printscreen"><?php echo JHtml::_('icon.print_screen',  $this->item, $params); ?></div>
		<?php endif; ?>

		<?php if ($params->get('show_title')) : ?>
		<h1 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; ?>
				
		</h1>
		<?php endif; ?>
		
		<?php if ($params->get('show_create_date') || ($params->get('show_author') && !empty($this->item->author)) || $params->get('show_category')) : ?>
		<p class="meta">
	
			<?php
				
				if ($params->get('show_author') && !empty($this->item->author )) {
					
					$author =  $this->item->author;
					$author = ($this->item->created_by_alias ? $this->item->created_by_alias : $author);
					
					if (!empty($this->item->contactid ) &&  $params->get('link_author') == true) {
						echo JText::sprintf('COM_CONTENT_WRITTEN_BY' , JHtml::_('link',JRoute::_('index.php?option=com_contact&view=contact&id='.$this->item->contactid),$author));
					} else {
						echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author);
					}

				}

				if ($params->get('show_create_date')) {
					echo ' '.JText::_('TPL_WARP_ON').' '.JHtml::_('date',$this->item->created, JText::_('DATE_FORMAT_LC3'));
				}

				echo '. ';
			
				if ($params->get('show_category')) {
					echo JText::_('TPL_WARP_POSTED_IN').' ';
					$title = $this->escape($this->item->category_title);
					$url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)).'">'.$title.'</a>';
					if ($params->get('link_category') AND $this->item->catslug) {
						echo $url;
					} else {
						echo $title;
					}
				}
			
			?>	
		
		</p>
		<?php endif; ?>

		<?php
		
			if (!$params->get('show_intro')) {
				echo $this->item->event->afterDisplayTitle;
			}
		
			echo $this->item->event->beforeDisplayContent;

			if (isset ($this->item->toc)) {
				echo $this->item->toc;
			}
			
		?>

		<div class="content">
		<?php
		
			if ($params->get('access-view')) {
				echo $this->item->text;
			
			// optional teaser intro text for guests
			} elseif ($params->get('show_noauth') == true AND $user->get('guest')) {
				
				echo $this->item->introtext;
				
				// optional link to let them register to see the whole article.
				if ($params->get('show_readmore') && $this->item->fulltext != null) {
					$link1 = JRoute::_('index.php?option=com_users&view=login');
					$link = new JURI($link1);
					echo '<p class="links">';
					echo '<a href="'.$link.'">';
					$attribs = json_decode($this->item->attribs);
		
					if ($attribs->alternative_readmore == null) {
						echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
					} elseif ($readmore = $this->item->alternative_readmore) {
						echo $readmore;
						if ($params->get('show_readmore_title', 0) != 0) {
							echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
						}
					} elseif ($params->get('show_readmore_title', 0) == 0) {
						echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');	
					} else {
						echo JText::_('COM_CONTENT_READ_MORE');
						echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
					}
					
					echo '</a></p>';
				}
			}
			
		?>
		</div>

		<?php if ($canEdit) : ?>
		<p class="edit"><?php echo JHtml::_('icon.edit', $this->item, $params); ?> <?php echo JText::_('TPL_WARP_EDIT_ARTICLE'); ?></p>
		<?php endif; ?>

		<?php echo $this->item->event->afterDisplayContent; ?>
	
	</div>

</div>
2. blog_item.php is like this so where do I have to make the modification here

Code: Select all

defined('_JEXEC') or die;

// Create a shortcut for params.
$params		= &$this->item->params;
$canEdit	= $this->item->params->get('access-edit');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::core();

?>

<div class="item">

	<?php if ($params->get('show_email_icon')) : ?>
	<div class="icon email"><?php echo JHtml::_('icon.email', $this->item, $params); ?></div>
	<?php endif; ?>

	<?php if ($params->get('show_print_icon')) : ?>
	<div class="icon print"><?php echo JHtml::_('icon.print_popup', $this->item, $params); ?></div>
	<?php endif; ?>

	<?php if ($params->get('show_title')) : ?>
	<h1 class="title">

		<?php if ($params->get('link_titles') && $params->get('access-view')) : ?>
			<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>" title="<?php echo $this->escape($this->item->title); ?>"><?php echo $this->escape($this->item->title); ?></a>
		<?php else : ?>
			<?php echo $this->escape($this->item->title); ?>
		<?php endif; ?>

	</h1>
	<?php endif; ?>

	<?php if ($params->get('show_create_date') || ($params->get('show_author') && !empty($this->item->author)) || $params->get('show_category')) : ?>
	<p class="meta">

		<?php
			
			if ($params->get('show_author') && !empty($this->item->author )) {
				
				$author =  $this->item->author;
				$author = ($this->item->created_by_alias ? $this->item->created_by_alias : $author);
				
				if (!empty($this->item->contactid ) &&  $params->get('link_author') == true) {
					echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link',JRoute::_('index.php?option=com_contact&view=contact&id='.$this->item->contactid),$author));
				} else {
					echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author);
				}

			}
	
			if ($params->get('show_create_date')) {
				echo ' '.JText::_('TPL_WARP_ON').' '.JHtml::_('date',$this->item->created, JText::_('DATE_FORMAT_LC2'));
			}

			echo '. ';

			if ($params->get('show_category')) {
				echo JText::_('TPL_WARP_POSTED_IN').' ';
				$title = $this->escape($this->item->category_title);
				$url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catid)).'">'.$title.'</a>';
				if ($params->get('link_category')) {
					echo $url;
				} else {
					echo $title;
				}
			}

		?>	
	
	</p>
	<?php endif; ?>

	<?php
	
		if (!$params->get('show_intro')) {
			echo $this->item->event->afterDisplayTitle;
		}
	
		echo $this->item->event->beforeDisplayContent;

	?>

	<div class="content"><?php echo $this->item->introtext; ?></div>


	<?php if ($params->get('show_readmore') && $this->item->readmore) : ?>
	<p class="links">
	
		<?php
		
			if ($params->get('access-view')) {
				$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
			} else {
				$menu = JFactory::getApplication()->getMenu();
				$active = $menu->getActive();
				$itemId = $active->id;
				$link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId);
				$returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug));
				$link = new JURI($link1);
				$link->setVar('return', base64_encode($returnURL));
			}
			
		?>

		<a href="<?php echo $link; ?>" title="<?php echo $this->escape($this->item->title); ?>">
			<?php
				
				if (!$params->get('access-view')) {
					echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
				} elseif ($readmore = $this->item->alternative_readmore) {
					echo $readmore;
				} else {
					echo JText::_('TPL_WARP_CONTINUE_READING');
				}
				
			?>
		</a>
		
	</p>
	<?php endif; ?>

	<?php if ($canEdit) : ?>
	<p class="edit"><?php echo JHtml::_('icon.edit', $this->item, $params); ?> <?php echo JText::_('TPL_WARP_EDIT_ARTICLE'); ?></p>
	<?php endif; ?>

	<?php echo $this->item->event->afterDisplayContent; ?>
	
</div>
3. default_item.php is like this so where do I have to make the modification here

Code: Select all

defined('_JEXEC') or die;

// Create a shortcut for params.
$params		= &$this->item->params;
$canEdit	= $this->item->params->get('access-edit');




?>

<div class="item">

	<?php if ($params->get('show_email_icon')) : ?>
	<div class="icon email"><?php echo JHtml::_('icon.email', $this->item, $params); ?></div>
	<?php endif; ?>

	<?php if ($params->get('show_print_icon')) : ?>
	<div class="icon print"><?php echo JHtml::_('icon.print_popup', $this->item, $params); ?></div>
	<?php endif; ?>

	<?php if ($params->get('show_title')) : ?>
	<h1 class="title">

		<?php if ($params->get('link_titles') && $params->get('access-view')) : ?>
			<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>" title="<?php echo $this->escape($this->item->title); ?>"><?php echo $this->escape($this->item->title); ?></a>
		<?php else : ?>
			<?php echo $this->escape($this->item->title); ?>
		<?php endif; ?>

	</h1>
	<?php endif; ?>

	<?php if ($params->get('show_create_date') || ($params->get('show_author') && !empty($this->item->author)) || $params->get('show_category')) : ?>
	<p class="meta">

		<?php
			
			if ($params->get('show_author') && !empty($this->item->author )) {
				
				$author =  $this->item->author;
				$author = ($this->item->created_by_alias ? $this->item->created_by_alias : $author);
				
				if (!empty($this->item->contactid ) &&  $params->get('link_author') == true) {
					echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link',JRoute::_('index.php?option=com_contact&view=contact&id='.$this->item->contactid),$author));
				} else {
					echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author);
				}

			}
	
			if ($params->get('show_create_date')) {
				echo ' '.JText::_('TPL_WARP_ON').' '.JHtml::_('date',$this->item->created, JText::_('DATE_FORMAT_LC2'));
			}

			echo '. ';

			if ($params->get('show_category')) {
				echo JText::_('TPL_WARP_POSTED_IN').' ';
				$title = $this->escape($this->item->category_title);
				$url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)).'">'.$title.'</a>';
				if ($params->get('link_category')) {
					echo $url;
				} else {
					echo $title;
				}
			}

		?>	
	
	</p>
	<?php endif; ?>

	<?php
	
		if (!$params->get('show_intro')) {
			echo $this->item->event->afterDisplayTitle;
		}
	
		echo $this->item->event->beforeDisplayContent;

	?>

	<div class="content"><?php echo $this->item->introtext; ?></div>


	<?php if ($params->get('show_readmore') && $this->item->readmore) : ?>
	<p class="links">
	
		<?php
		
			if ($params->get('access-view')) {
				$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
			} else {
				$menu = JFactory::getApplication()->getMenu();
				$active = $menu->getActive();
				$itemId = $active->id;
				$link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId);
				$returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug));
				$link = new JURI($link1);
				$link->setVar('return', base64_encode($returnURL));
			}
			
		?>

		<a href="<?php echo $link; ?>" title="<?php echo $this->escape($this->item->title); ?>">
			<?php
				
				if (!$params->get('access-view')) {
					echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
				} elseif ($readmore = $this->item->alternative_readmore) {
					echo $readmore;
				} else {
					echo JText::_('TPL_WARP_CONTINUE_READING');
				}
				
			?>
		</a>
		
	</p>
	<?php endif; ?>

	<?php if ($canEdit) : ?>
	<p class="edit"><?php echo JHtml::_('icon.edit', $this->item, $params); ?> <?php echo JText::_('TPL_WARP_EDIT_ARTICLE'); ?></p>
	<?php endif; ?>

	<?php echo $this->item->event->afterDisplayContent; ?>
	
</div>
Hope someone can give me an idea how to make it work.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: No PDF icon with yootheme template

Post by Jan »

Hi, if your template overrides the core files, the modifications must be done in the html folder in the template (so you will compare the edited files with the files in the html folder in the template)

Jan
If you find Phoca extensions useful, please support the project
koppie7
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 27 Jul 2010, 20:43

Re: No PDF icon with yootheme template

Post by koppie7 »

I'm a newbie on this so, do I have to modify it only with the php-code that was inserted with the name PHOCAEDIT?

Code: Select all

<?php
//PHOCAEDIT
$phocaPDF = false;
if (JPluginHelper::isEnabled('phocapdf', 'content')) {
	include_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_phocapdf'.DS.'helpers'.DS.'phocapdf.php');
	$phocaPDF = PhocaPDFHelper::getPhocaPDFContentIcon($this->item, $params);
}
?>

<?php if ($canEdit ||  $params->get('show_print_icon') || $params->get('show_email_icon') || $phocaPDF) : ?>
		<ul class="actions">
		<?php echo $phocaPDF; //END PHOCAEDIT ?>
or should the whole core file be inserted in the template file?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: No PDF icon with yootheme template

Post by Jan »

Hi, depends on you, you can move the whole file there but then you will lose the changes made by the template.

Jan
If you find Phoca extensions useful, please support the project
koppie7
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 27 Jul 2010, 20:43

Re: No PDF icon with yootheme template

Post by koppie7 »

Like I said, I'm not familiar with PHP.
In the template files are the only line the following ones

Code: Select all

// include config and layout
$base = dirname(dirname(dirname(__FILE__)));
include($base.'/config.php');
include($warp->path->path('layouts:'.preg_replace('/'.preg_quote($base, '/').'/', '', __FILE__, 1)));
What do I have to do to make it work, where do I put it?
And should I delete the changes made in the core files?

btw; copying the whole file messes up the layout of my site.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: No PDF icon with yootheme template

Post by Jan »

Hi, just compare the article file with the file which will override it (you can see it in frontend of com_content folder after Phoca PDF will make the new file and old will be backuped - so you can compare both files to check the changes - for now I am not able to say exactly what should be changed - :(

forum-rules.php (9)
If you find Phoca extensions useful, please support the project
Post Reply