navigation entre articles d'une même catégorie

More
13 years 8 months ago #14411 by Claire39
Bonjour,

comme tous ceux qui m'ont précédé dans ce topic, moi aussi je cherche à obtenir les boutons "suivant" et "précédent" pour les articles d'une catégorie.

quelque part, même si cela ne s'affiche pas tout à fait là où j'ai demandé dans les réglages du plugin, je serais intéressée par la solution de Dingdawn, si il veut bien me la communiquer.

merci!

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

More
13 years 8 months ago #14412 by micker
voici la solution
a mettre dans le item.php de votre template
Code:
<?php $html = ''; global $mainframe; $db = & JFactory::getDBO(); $user = & JFactory::getUser(); $uid = $this->item->id; $config = & JFactory::getConfig(); // Determine sort order //a.created //a.hits //a.ordering //f.ordering $orderby = 'a.created'; $query = 'SELECT a.id,a.title,a.introtext,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,' . ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug' . ' FROM #__content AS a' . ' LEFT JOIN #__categories AS cc ON cc.id = a.catid' . ' WHERE a.catid = ' . (int) $this->item->catid . ' AND a.access <= ' .(int) $user->get('aid', 0) . ' ORDER BY '. $orderby; $db->setQuery($query); $list = $db->loadObjectList('id'); // this check needed if incorrect Itemid is given resulting in an incorrect result if ( !is_array($list) ) { $list = array(); } reset($list); // location of current content item in array list $location = array_search($this->item->id, array_keys($list)); //echo $location; $rows = array_values($list); $prev = array(); $next = array(); if ($location -1 >= 0) { // the previous content item cannot be in the array position -1 $prev = $rows[$location -1]; } if (($location +1) < count($rows)) { // the next content item cannot be in an array position greater than the number of array postions $next = $rows[$location +1]; } $pnSpace = ""; if (JText::_('&lt') || JText::_('&gt')) { $pnSpace = " "; } $prevlink=JRoute::_('index.php?option=com_flexicontent&view=items&cid='.$this->item->catid.'&id='.$prev->id); $nextlink=JRoute::_('index.php?option=com_flexicontent&view=items&cid='.$this->item->catid.'&id='.$next->slug); $limit = 200; if ($prev) { $prevTitle=$prev->title; if (JString::strlen(strip_tags($prev->introtext)) > $limit) { $limit = JString::strpos(strip_tags($prev->introtext), " ", $limit); $prevIntro = JString::substr(strip_tags($prev->introtext), 0, $limit). '...'; } } else { $prev = ''; } if ($next) { $nextTitle=$next->title; if (JString::strlen(strip_tags($next->introtext)) > $limit) { $limit = JString::strpos(strip_tags($next->introtext), " ", $limit); $nextIntro = JString::substr(strip_tags($next->introtext), 0, $limit). '...'; } } else { $next = ''; } $header='<style type="text/css"> a.PageNav:link, a.PageNav:visited { padding: 2px 8px 2px 8px; color: #DB1919;} a.PageNav:hover {background-color: #DB1919; color: #1D1916;} </style>'; $mainframe->addCustomHeadTag($header); JHTML::_('behavior.tooltip'); if ($prev || $next) { $html = '<div class="pagenav"><hr/> '; if ($prev) { $html .= '<span class="hasTip" title="'.$prevIntro.'"><a href="'. $prevlink .'" class="PageNavPrev" title="'. $prevTitle. '"> '. $prevTitle. ' </span>'; } else { $html .= '<span>&nbsp;</span>'; } if ($next) { $html .= '<span class="hasTip" style="float:right;" title="'.$nextIntro.'"><a href="'. $nextlink .'" class="PageNavNext" title="'. $nextTitle .'"> '. $nextTitle .' </span>'; } else { $html .= '<span>&nbsp;</span>'; } $html .= '<hr/></div>'; echo $html; } ?>
vue ici <!-- l --><a class="postlink-local" href=" www.flexicontent.org/phpbb/viewtopic.php...21&hilit=next#p12821 ">viewtopic.php?f=30&t=2703&p=12821&hilit=next#p12821

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
13 years 8 months ago #14413 by Claire39
merci beaucoup!
c'est exactement ce que je souhaitais :)

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

More
13 years 7 months ago #14694 by Claire39
la nouvelle version de Flexicontent gère directement cette fonctionnalité
il faut :
créer un nouveau champ de type Flexicontent-page navigation, et de l'insérer dans le template concerné.
c'est très pratique, et génère des liens compatibles avec AceSef!

merci pour cette fonctionnalité supplémentaire!
:D

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.367 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