Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: Remove comment form from print view ...
Pages: [1]   Go Down
  Print  
Author Topic: Remove comment form from print view ...  (Read 2214 times)
0 Members and 2 Guests are viewing this topic.
~cXc~
Newbie
*

Karma: 0
Offline Offline

Posts: 5



« on: October 30, 2010, 08:35:30 »

I'm not sure if this is a problem for com_content or not because I'm using FlexiContent but on it when I click print it still displays the comments and comment form. I actually like printing the comments with the page but I don't see the point in printing the comments form. I've got something working now that solves this issue for me but an official option (?) would be preferred.

Right now I'm wrapping the comments form with an if that checks to see if its in print mode and if it is it doesn't display.

components\com_jcomments\tpl\default\tpl_form.php

Code:
/*
*
* Comments form template
*
*/
class jtt_tpl_form extends JoomlaTuneTemplate
{
function render()
{
if ($this->getVar('comments-form-message', 0) == 1) {
$this->getMessage( $this->getVar('comments-form-message-text') );
return;
}

if ($this->getVar('comments-form-link', 0) == 1) {
$this->getCommentsFormLink();
return;
}

// ~cXc~ remove form if in print mode
// $this->getCommentsFormFull();
$options = new stdClass;
$options->print  = JRequest::getBool('print') || $full;
if ( ! $options->print ){
$this->getCommentsFormFull();
}
}
... its a really simple idea that I hope you could do a better way this was just a quick fix a client asked me for that I thought might be a good idea.

In the code block above it is lines 20 - 26 where the changes were made ....
« Last Edit: October 30, 2010, 08:37:59 by ~cXc~ » Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: November 04, 2010, 03:51:54 »

This isn't JComments' issue but FLEXIcontent integration. When JComments is used inside com_content it is embeded by Content - JComments plugin that already has such check:

Code: (php)
if (!JPluginHelper::isEnabled('content', 'jcomments')
|| ($view != 'article')
|| $params->get('intro_only')
|| $params->get('popup')
|| JRequest::getBool('fullview')
|| JRequest::getVar('print')) {
JCommentsContentPluginHelper::clear($article, true);
return '';
}

This check prevents to show comments in print or popup views. So if any 3rd party extension has something like print version it needed to disable loading comments for this case.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
~cXc~
Newbie
*

Karma: 0
Offline Offline

Posts: 5



« Reply #2 on: November 05, 2010, 03:27:10 »

Thank you smart I will try pass this on to Flexi developers, I don't speak french though so wish me luck, I will link back here so they know I'm not some crazy guy.

For my own reference is the JComments API fully documented anywhere?
Does it explain how these options are or can be applied?
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #3 on: November 05, 2010, 17:15:34 »

I don't speak french though so wish me luck
Don't worry, Emmanuel speaks english Wink BTW sometimes he visits this forum too Wink

For my own reference is the JComments API fully documented anywhere? Does it explain how these options are or can be applied?
This isn't complete but some information is available here: http://www.joomlatune.com/jcomments-developers-manual.html
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: Remove comment form from print view ...
 
Jump to: