Création de sous-menu lié à chaque article [solved]

More
12 years 2 months ago #42374 by eastkilla
Hi ggppdk,

I try your code but it doesn't work. My comment system is no more displayed. This is my modified item.php :
Code:
<?php /** * @version 1.5 stable $Id: item.php 1538 2012-11-05 02:44:34Z ggppdk $ * @package Joomla * @subpackage FLEXIcontent * @copyright (C) 2009 Emmanuel Danan - www.vistamedia.fr * @license GNU/GPL v2 * * FLEXIcontent is a derivative work of the excellent QuickFAQ component * @copyright (C) 2008 Christoph Lukes * see www.schlu.net for more information * * FLEXIcontent is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ defined( '_JEXEC' ) or die( 'Restricted access' ); // first define the template name $tmpl = $this->tmpl; $item = $this->item; $menu = JFactory::getApplication()->getMenu()->getActive(); // USE HTML5 or XHTML $html5 = $this->params->get('htmlmode', 0); // 0 = XHTML , 1 = HTML5 if ($html5) { /* BOF html5 */ echo $this->loadTemplate('html5'); } else { JFactory::getDocument()->addScript( JURI::base(true).'/components/com_flexicontent/assets/js/tabber-minimized.js'); JFactory::getDocument()->addStyleSheet(JURI::base(true).'/components/com_flexicontent/assets/css/tabber.css'); // Prepend toc (Table of contents) before item's description (toc will usually float right) // By prepend toc to description we make sure that it get's displayed at an appropriate place if (isset($item->toc)) { $item->fields['text']->display = $item->toc . $item->fields['text']->display; } // *********** // DECIDE TAGS // *********** $page_heading_shown = $this->params->get( 'show_page_heading', 1 ) && $this->params->get('page_heading') != $item->title; // Main container $mainAreaTag = 'div'; // SEO, header level of title tag $itemTitleHeaderLevel = '2'; // SEO, header level of tab title tag $tabsHeaderLevel = $itemTitleHeaderLevel == '2' ? '3' : '2'; $page_classes = 'flexicontent'; $page_classes .= $this->pageclass_sfx ? ' page'.$this->pageclass_sfx : ''; $page_classes .= ' fcitems fcitem'.$item->id; $page_classes .= ' fctype'.$item->type_id; $page_classes .= ' fcmaincat'.$item->catid; if ($menu) $page_classes .= ' menuitem'.$menu->id; ?> <?php echo '<'.$mainAreaTag; ?> id="flexicontent" class="<?php echo $page_classes; ?> group" > <?php echo ( ($mainAreaTag == 'section') ? '<header>' : ''); ?> <?php if ($item->event->beforeDisplayContent) : ?> <!-- BOF beforeDisplayContent --> <div class="fc_beforeDisplayContent group"> <?php echo $item->event->beforeDisplayContent; ?> </div> <!-- EOF beforeDisplayContent --> <?php endif; ?> <?php $pdfbutton = flexicontent_html::pdfbutton( $item, $this->params ); $mailbutton = flexicontent_html::mailbutton( FLEXI_ITEMVIEW, $this->params, $item->categoryslug, $item->slug ); $printbutton = flexicontent_html::printbutton( $this->print_link, $this->params ); $editbutton = flexicontent_html::editbutton( $item, $this->params ); $statebutton = flexicontent_html::statebutton( $item, $this->params ); $approvalbutton = flexicontent_html::approvalbutton( $item, $this->params ); ?> <?php if ($pdfbutton || $mailbutton || $printbutton || $editbutton || $statebutton || $approvalbutton) : ?> <!-- BOF buttons --> <div class="buttons"> <?php echo $pdfbutton; ?> <?php echo $mailbutton; ?> <?php echo $printbutton; ?> <?php echo $editbutton; ?> <?php echo $statebutton; ?> <?php echo $approvalbutton; ?> </div> <!-- EOF buttons --> <?php endif; ?> <?php if ( $this->params->get( 'show_page_heading', 1 ) ) : ?> <!-- BOF page heading --> <h1 class="componentheading"> <?php echo $this->params->get('page_heading'); ?> </h1> <!-- EOF page heading --> <?php endif; ?> <?php echo ( ($mainAreaTag == 'section') ? '</header>' : ''); ?> <?php echo ( ($mainAreaTag == 'section') ? '<article>' : ''); ?> <?php $header_shown = $this->params->get('show_title', 1) || $item->event->afterDisplayTitle || isset($item->positions['subtitle1']) || isset($item->positions['subtitle2']) || isset($item->positions['subtitle3']); ?> <?php if ($this->params->get('show_title', 1)) : ?> <!-- BOF item title --> <?php echo '<h'.$itemTitleHeaderLevel; ?> class="contentheading"><span class="fc_item_title"> <?php echo ( mb_strlen($item->title, 'utf-8') > $this->params->get('title_cut_text',200) ) ? mb_substr ($item->title, 0, $this->params->get('title_cut_text',200), 'utf-8') . ' ...' : $item->title; ?> </span><?php echo '</h'.$itemTitleHeaderLevel; ?>> <!-- EOF item title --> <?php endif; ?> <?php if ($item->event->afterDisplayTitle) : ?> <!-- BOF afterDisplayTitle --> <div class="fc_afterDisplayTitle group"> <?php echo $item->event->afterDisplayTitle; ?> </div> <!-- EOF afterDisplayTitle --> <?php endif; ?> <?php if (isset($item->positions['subtitle1'])) : ?> <!-- BOF subtitle1 block --> <div class="flexi lineinfo subtitle1 group"> <?php foreach ($item->positions['subtitle1'] as $field) : ?> <div class="flexi element"> <?php if ($field->label) : ?> <span class="flexi label field_<?php echo $field->name; ?>"><?php echo $field->label; ?></span> <?php endif; ?> <div class="flexi value field_<?php echo $field->name; ?>"><?php echo $field->display; ?></div> </div> <?php endforeach; ?> </div> <!-- EOF subtitle1 block --> <?php endif; ?> <?php if (isset($item->positions['subtitle2'])) : ?> <!-- BOF subtitle2 block --> <div class="flexi lineinfo subtitle2 group"> <?php foreach ($item->positions['subtitle2'] as $field) : ?> <div class="flexi element"> <?php if ($field->label) : ?> <span class="flexi label field_<?php echo $field->name; ?>"><?php echo $field->label; ?></span> <?php endif; ?> <div class="flexi value field_<?php echo $field->name; ?>"><?php echo $field->display; ?></div> </div> <?php endforeach; ?> </div> <!-- EOF subtitle2 block --> <?php endif; ?> <?php if (isset($item->positions['subtitle3'])) : ?> <!-- BOF subtitle3 block --> <div class="flexi lineinfo subtitle3 group"> <?php foreach ($item->positions['subtitle3'] as $field) : ?> <div class="flexi element"> <?php if ($field->label) : ?> <span class="flexi label field_<?php echo $field->name; ?>"><?php echo $field->label; ?></span> <?php endif; ?> <div class="flexi value field_<?php echo $field->name; ?>"><?php echo $field->display; ?></div> </div> <?php endforeach; ?> </div> <!-- EOF subtitle3 block --> <?php endif; ?> <div class="fcclear"></div> <?php // Find if at least one tabbed position is used $tabcount = 6; $createtabs = false; for ($tc=1; $tc<=$tabcount; $tc++) { $createtabs = @$createtabs || isset($item->positions['subtitle_tab'.$tc]); } ?> <?php if ($createtabs) :?> <!-- tabber start --> <div id="fc_subtitle_tabset" class="fctabber group"> <?php for ($tc=1; $tc<=$tabcount; $tc++) : ?> <?php $tabpos_name = 'subtitle_tab'.$tc; $tabpos_label = JText::_($this->params->get('subtitle_tab'.$tc.'_label', $tabpos_name)); $tab_id = 'fc_'.$tabpos_name; ?> <?php if (isset($item->positions[$tabpos_name])): ?> <!-- tab start --> <div id="<?php echo $tab_id; ?>" class="tabbertab"> <h3 class="tabberheading"><?php echo $tabpos_label; ?></h3><!-- tab title --> <div class="flexi lineinfo"> <?php foreach ($item->positions[$tabpos_name] as $field) : ?> <div class="flexi element"> <?php if ($field->label) : ?> <span class="flexi label field_<?php echo $field->name; ?>"><?php echo $field->label; ?></span> <?php endif; ?> <div class="flexi value field_<?php echo $field->name; ?>"><?php echo $field->display; ?></div> </div> <?php endforeach; ?> </div> </div> <!-- tab end --> <?php endif; ?> <?php endfor; ?> </div> <!-- tabber end --> <?php endif; ?> <div class="fcclear"></div> <?php if ((isset($item->positions['image'])) || (isset($item->positions['top']))) : ?> <!-- BOF image/top row --> <div class="flexi topblock group"> <!-- NOTE: image block is inside top block ... --> <?php if (isset($item->positions['image'])) : ?> <!-- BOF image block --> <?php foreach ($item->positions['image'] as $field) : ?> <div class="flexi image field_<?php echo $field->name; ?>"> <?php echo $field->display; ?> <div class="clear"></div> </div> <?php endforeach; ?> <!-- EOF image block --> <?php endif; ?> <?php if (isset($item->positions['top'])) : ?> <!-- BOF top block --> <?php $top_cols = $this->params->get('top_cols', 'two'); $span_class = $top_cols == 'one' ? 'span12' : 'span6'; // bootstrap span ?> <div class="flexi infoblock <?php echo $top_cols; ?>cols group"> <ul class="flexi"> <?php foreach ($item->positions['top'] as $field) : ?> <li class="flexi"> <div> <?php if ($field->label) : ?> <span class="flexi label field_<?php echo $field->name; ?>"><?php echo $field->label; ?></span> <?php endif; ?> <div class="flexi value field_<?php echo $field->name; ?>"><?php echo $field->display; ?></div> </div> </li> <?php endforeach; ?> </ul> </div> <!-- EOF top block --> <?php endif; ?> </div> <!-- EOF image/top row --> <?php endif; ?> <div class="fcclear"></div> <?php if (isset($item->positions['description'])) : ?> <!-- BOF description --> <div class="description group"> <?php foreach ($item->positions['description'] as $field) : ?> <?php if ($field->label) : ?> <div class="desc-title"><?php echo $field->label; ?></div> <?php endif; ?> <div class="desc-content"><?php echo $field->display; ?></div> <?php endforeach; ?> </div> <!-- EOF description --> <?php endif; ?> <div class="fcclear"></div> <?php // Find if at least one tabbed position is used $tabcount = 6; $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"> <?php for ($tc=1; $tc<=$tabcount; $tc++) : ?> <?php $tabpos_name = 'bottom_tab'.$tc; $tabpos_label = JText::_($this->params->get('bottom_tab'.$tc.'_label', $tabpos_name)); $tab_id = 'fc_'.$tabpos_name; ?> <?php if (isset($item->positions[$tabpos_name])): ?> <!-- tab start --> <div id="<?php echo $tab_id; ?>" class="tabbertab"> <h3 class="tabberheading"><?php echo $tabpos_label; ?></h3><!-- tab title --> <div class="flexi lineinfo"> <?php foreach ($item->positions[$tabpos_name] as $field) : ?> <div class="flexi element"> <?php if ($field->label) : ?> <span class="flexi label field_<?php echo $field->name; ?>"><?php echo $field->label; ?></span> <?php endif; ?> <div class="flexi value field_<?php echo $field->name; ?>"><?php echo $field->display; ?></div> </div> <?php endforeach; ?> </div> </div> <!-- tab end --> <?php endif; ?> <?php endfor; ?> <?php if ($this->params->get('comments') && !JRequest::getVar('print')) : ?> <!-- tab start --> <div id="<?php echo $tab_id; ?>" class="tabbertab"> <h3 class="tabberheading"><?php echo $tabpos_label; ?></h3><!-- tab title --> <!-- BOF comments --> <div class="comments group"> <?php 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; if ($this->params->get('comments') == 2) : if (file_exists(JPATH_SITE.DS.'plugins'.DS.'content'.DS.'jom_comment_bot.php')) : require_once(JPATH_SITE.DS.'plugins'.DS.'content'.DS.'jom_comment_bot.php'); echo jomcomment($item->id, 'com_flexicontent'); endif; endif; ?> </div> <!-- BOF comments --> </div> <!-- tab end --> <?php endif; ?> </div> <!-- tabber end --> <?php endif; ?> <div class="fcclear"></div> <?php $footer_shown = isset($item->positions['bottom']) || $item->event->afterDisplayContent; ?> <?php if (isset($item->positions['bottom'])) : ?> <!-- BOF bottom block --> <?php $bottom_cols = $this->params->get('bottom_cols', 'two'); $span_class = $bottom_cols == 'one' ? 'span12' : 'span6'; // bootstrap span ?> <div class="flexi infoblock <?php echo $bottom_cols; ?>cols group"> <ul class="flexi"> <?php foreach ($item->positions['bottom'] as $field) : ?> <li class="flexi"> <div> <?php if ($field->label) : ?> <span class="flexi label field_<?php echo $field->name; ?>"><?php echo $field->label; ?></span> <?php endif; ?> <div class="flexi value field_<?php echo $field->name; ?>"><?php echo $field->display; ?></div> </div> </li> <?php endforeach; ?> </ul> </div> <!-- EOF bottom block --> <?php endif; ?> <?php if ($item->event->afterDisplayContent) : ?> <!-- BOF afterDisplayContent --> <div class="fc_afterDisplayContent group"> <?php echo $item->event->afterDisplayContent; ?> </div> <!-- EOF afterDisplayContent --> <?php endif; ?> <?php echo $mainAreaTag == 'section' ? '</article>' : ''; ?> <?php echo '</'.$mainAreaTag.'>'; ?> <?php } /* EOF if html5 */ ?>

Thanks a lot for your help !

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

More
12 years 2 months ago #42375 by ggppdk
Hello,

this modification works, i have tested it
and you seem to have added it correctly


but have added some OTHER fields in the 'bottom_tab' positions ?

otherwise the 'bottom_tab' tabset is considered empty and will not appear, maybe you have added field to the 'subtitle_tab' positions instead of 'bottom_tab' positions

Also in order to have a correct TAB label:
replace:
Code:
<?php if ($this->params->get('comments') && !JRequest::getVar('print')) : ?> <!-- tab start --> <div id="<?php echo $tab_id; ?>" class="tabbertab"> <h3 class="tabberheading"><?php echo $tabpos_label; ?></h3><!-- tab title -->
with
Code:
<?php if ($this->params->get('comments') && !JRequest::getVar('print')) : ?> <!-- tab start --> <div id="fc_comments_tab" class="tabbertab"> <h3 class="tabberheading"><?php echo JText::_('Comments'); ?></h3><!-- tab title -->


-- 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 review. Thanks!

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

More
12 years 2 months ago #42398 by eastkilla
Hi gg ppdk,

You are the best, sincerly. I have added fields in 'subtitle_tab', that is why it's not working.

Now it works !! What is the difference between subtitle_tab and bottom tab ?

Just another question :

With your code, my comments are displayed in new tab titled "comments".

Is it possible to chose in which tab my comments are displayed ? For exemple, I would like to create a tab "description" with field "description and my comments will be displayed uder this field.

Thanks so much for your help and your time.

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

More
12 years 2 months ago #42401 by ggppdk
Move the code:
Code:
<?php if ($this->params->get('comments') && !JRequest::getVar('print')) : ?> ................ <?php endif; ?>

Inside the 2 loops, immediately after the div:
Code:
<div class="flexi element"> ... </div> --------------> HERE <----------------- <?php endforeach; ?>


and change the if statement to be:
Code:
<?php if ($tc==1 && $this->params->get('comments') && !JRequest::getVar('print')) : ?> ................ <?php endif; ?>

NOTICE above:
$tc==1 &&
so add you description field inside first tab


-- 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 review. Thanks!

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

More
12 years 2 months ago - 12 years 2 months ago #42405 by eastkilla
ggppdk, I don't know how to thanks you !

It's the first time I need help and I have never seen a support like that !

You give me all solutions I needed, it's so fantasic !

I have tried many support on many sites (free and not free) and I have never seen so professional guys like you !

Thanks a lot ! Long life to flexicontent !

I have create this topic :
www.flexicontent.org/forum/index.php?f=20&t=7152&rb_v=viewtopic
Last edit: 12 years 2 months ago by eastkilla.

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

More
12 years 2 months ago #42407 by ggppdk
Hello

thank you for your words,

we are mostly interested into answering bug reports, and logging interesting user suggestions

you understand free custom templating help is not possible (sometimes other community members take time to answer these),

but since your question is interesting i took time to answer you, because i am thinking this may be an interesting modification for flexicontent modular item layout ;)

Regards


-- 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 review. Thanks!

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

Moderators: vistamediajoomlacornerggppdk
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
Save