printing guestbook (j2.5)

Phoca Guestbook - creating guestbooks in Joomla! CMS
dip
Phoca Member
Phoca Member
Posts: 43
Joined: 09 Apr 2012, 16:33
Location: Russia

printing guestbook (j2.5)

Post by dip »

I need to print all messages from PGB. Global idea - opening new window with prepared to printing design.
At first I prepare PGB and create 2 menulink:
1) To post messages and web-reading.
Menu Item Type = Guestbook.
Link = index.php?option=com_phocaguestbook&view=guestbook&id=1
ID=1001
2) To print messages for off-line reading.
Menu Item Type = External URL
Link = index.php?option=com_phocaguestbook&view=guestbook&id=1&tmpl=component&print=1
ID=1002

When I use 2nd menulink from frontend, SEF change url to "index.php/component/phocaguestbook/?tmpl=component&print=1&Itemid=1002". Result = error 404.
When I manually run 2nd url via addressbar - it's work.
When I run it via Menu Item Type "Iframe Wrapper" - it's work. But iframe - is bad way for me (not clear design to print).

I need both - SEF and right url to print view (or different way to print).
Any advices? :idea:

PS: I already read it https://www.phoca.cz/documents/16-joomla ... -in-joomla but don't understand, how to used it in this situation.
Last edited by dip on 03 Sep 2012, 00:54, edited 1 time in total.
dip
Phoca Member
Phoca Member
Posts: 43
Joined: 09 Apr 2012, 16:33
Location: Russia

Re: printing guestbook (j2.5)

Post by dip »

I found workaround solution.
But I still waiting ideas about menulink! :?:

Just customize com_phocaguestbook_v2.0.5\site\views\guestbook\tmpl\default.php

Code: Select all

// - - - - - - - - - - -
// Header
// - - - - - - - - - - -
echo '<div id="phocaguestbook" class="guestbook'.$this->params->get( 'pageclass_sfx' ).'">';

//* start print buttons
$gbPosts = '<div class="itemPrint">';
if(JRequest::getInt('print')==1) {
	$gbPosts .=  '<a class="itemPrintThisPage" rel="nofollow" href="#" onclick="window.print(); return false;">' . JText::_('K2_PRINT_THIS_PAGE') . '</a>';
} else {
	$gbPosts .= '<a class="itemPrintThisPage" rel="nofollow" href="' .JRoute::_('index.php?option=com_phocaguestbook&view=guestbook&id='.$this->id.'&tmpl=component&print=1') .'" onclick="window.open(this.href,\'printWindow\',\'width=900,height=600,location=no,menubar=no,resizable=yes,scrollbars=yes\'); return false;">'.JText::_('K2_PRINT').'</a>';
}
$gbPosts .= '</div>';
echo $gbPosts;
//*end print buttons

if ( $this->params->get( 'show_page_heading' ) ) { 
	echo '<h1>'. $this->escape($this->params->get('page_heading')) . '</h1>';
}
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48739
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: printing guestbook (j2.5)

Post by Jan »

Hi, I think, you cannot do the "print link" more SEF available :-(

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