Previous / next in blogitems

More
13 years 10 months ago #12466 by tastymouse
When a visitor clicks a read more link in the blog-category, they can't go to the next or previous item directly. They have to go back to the blog first.

This isn't very user-friendly. A previous and next button within the current category would be nice.

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

More
13 years 10 months ago #12467 by micker
Replied by micker on topic Previous / next in blogitems
i am agree +1
regards

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 9 months ago #12810 by effrit
Replied by effrit on topic Previous / next in blogitems
my comrad beagler from Russian forum try convert standard plugin for flexi but we cant made it (the mechanism of calling content plugin in flexi work strange, so some plugins produce bugs or even didn work :( )
so he just insert code in item's template and seems it work.
if you need it - insert this code in item.php of flexicontent template(s):
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.title'; $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 = 1000; 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; } ?>

the result is not equivalent of standard prev/next. you may see demo of this code here:
3dea.ru/polezno/stili-interera/i ... -stil.html
its on Russian, so just scroll to bottom of page to the links of next/previous pages.

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

More
13 years 9 months ago #12812 by tastymouse
Nice, with preview! I'll check it out.
Thanks, Tom

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

More
13 years 9 months ago #12819 by micker
Replied by micker on topic Previous / next in blogitems
hello for me it work ... a little
the return link doesn't work (doesn't display).. and resume on over doesn't work ...
you can see it
www.le-bijou.net/concerts/progra ... istan.html
it's possible to created this link in function of date of order ?
regards

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 9 months ago #12820 by effrit
Replied by effrit on topic Previous / next in blogitems
micker, i post the solution "as is" and i am not the author...
so its just a starting point for people with php skill :)
the preview working at least on this page
www.le-bijou.net/concerts/progra ... ivier.html
see right link.
so you may try understand why it didnt appear on another links.

sorry, i am just posting this without try it myself, so may be later i try figure out how make it more customizable.

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

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