[SOLVED] Is it possible to put Jcomments comments in a tab instead of the bottom of the article?

More
9 years 3 weeks ago - 9 years 3 weeks ago #57671 by randonneur
Est-ce possible de mettre les commentaires Jcomments dans un tab au lieu du bas de l'article ?

Is it possible to put Jcomments comments in a tab instead of the bottom of the article?

Pierre A. Martin
community & web project manager diplômé
Valais (CH)
Last edit: 9 years 3 weeks ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
9 years 3 weeks ago - 9 years 3 weeks ago #57680 by ggppdk
Hello

You need either to have some PHP knowledge
or otherwise just try to apply the following without any errors


1. create a custom template in FLEXIcontent backend templates manager by copying an existing
(choose to copy a template that has TABs in item view, e.g. copy template "default")

2. click to edit the "item" layout of the new template

3. go to TAB "edit files" and click to edit the file "item.php"

4. click Load/customize system's default

5. find:
Code:
<?php // Find if at least one tabbed position is used $tabcount = 12; $createtabs = false; for ($tc=1; $tc<=$tabcount; $tc++) { $createtabs = @$createtabs || isset($item->positions['bottom_tab'.$tc]); } ?> <?php if ($createtabs) :?> <!-- tabber start --> <div id="fc_bottom_tabset" class="fctabber group">

Above this line:
Code:
<?php if ($createtabs) :?>


Add:
Code:
<?php // INJECT JCOMMENTS INSIDE A TAB ob_start(); if ($this->params->get('comments') == 1) : if (file_exists(JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php')) : require_once(JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php'); echo JComments::showComments($item->id, 'com_flexicontent', $this->escape($item->title)); endif; endif; $comments_html = trim(ob_get_contents()); $this->params->set('comments', 0); if ($comments_html) { $createtabs = 1; $tc = 1; // TAB POSITION $tabpos_name = 'bottom_tab'.$tc; $field = new stdClass(); $this->params->set($tabpos_name.'_label', 'MY_LANG_STRING_COMMENTS'); $this->params->set('comments', 0); $field->label = false; $field->name = $tabpos_name.'_comments'; $field->display = $comments_html; $item->positions[$tabpos_name][] = $field; } ?>

make sure to set:
$tc = 1; // TAB POSITION

to be a TAB that does not exist , e.g. if you already have 3 TABs
set it to 4


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 9 years 3 weeks ago by ggppdk.
The following user(s) said Thank You: randonneur

Please Log in or Create an account to join the conversation.

More
9 years 3 weeks ago #57682 by ggppdk
Hello

It makes sense to make a field for custom placement of comments

github.com/FLEXIcontent/flexicontent-cck/issues/311


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
The following user(s) said Thank You: randonneur

Please Log in or Create an account to join the conversation.

More
9 years 3 weeks ago #57687 by randonneur
Thank you for the help. great

Pierre A. Martin
community & web project manager diplômé
Valais (CH)

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.308 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline