Pagination in a page which I found.

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
bisyarin
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 07 Apr 2008, 01:41
Location: Ukraine

Hello!Thank yo

Post by bisyarin »

Hello!
Thank you for Phoca***.
I have a question about PhocaGallery+PhocaGallerySearchPlugin.
In search results we can see links similar to this:
"http://127.0.0.1/joomla/index.php?optio ... egory&id=7".
When we click on a link like this one, joomla transfers content of a category to us. But the page with this content is without pagination.
When I click on a menu item with a link like this:
"http://127.0.0.1/joomla/index.php?optio ... =7&Itemid= 12"
I get a page with pagination.

Is it possible to get a page with pagination from search results?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47916
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Hi, the problem is t

Post by Jan »

Hi, the problem is that the pagination is created by menu link in Joomla! and the search result is no menu link, so the pagination will be not displayed
If you find Phoca extensions useful, please support the project
bisyarin
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 07 Apr 2008, 01:41
Location: Ukraine

Hello again!Th

Post by bisyarin »

Hello again!
Thank you for your reply.
I have added some basic support for this problem.
"components/com_content/helpers/route.php" was used as an example.
Also I have added very basic support for viewing images directly from the search results page.
Please, review my code. I'll be glad to see my code in your application (if the code is correct).
I mark my code by "By Bisyarin Artyom <date>" strings.

File: http://rapidshare.com/files/105663390/p ... h.zip.html (the link was updated)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47916
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Sorry but I have no

Post by Jan »

Sorry but I have no rights to download the file...
If you find Phoca extensions useful, please support the project
bisyarin
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 07 Apr 2008, 01:41
Location: Ukraine

Post by bisyarin »

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47916
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

hmmm, my question is

Post by Jan »

hmmm, my question is:

- if you have add 'same' code as in route.php, work it with/without SEF enabled...

- I don't understand this:
$list1[$key]->href = JRoute::_('images' . DS . 'phocagallery' . DS . $item->file
name);

instead of this:

$list1[$key]->href = JRoute::_('index.php?option=com_phocagallery&view=category&
id='.$item->catslug );


It produces:
../images%5Cphocagallery%5C/category/image.png (will not work)

instead of:
../index.php?option=com_phocagallery&view=category&id=34:category

???

The problem is, the Itemid must be find in com_menus table...
The second problem is, which Itemid should be taken if link fot categories and category view are created...

Jan
If you find Phoca extensions useful, please support the project
bisyarin
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 07 Apr 2008, 01:41
Location: Ukraine

Hi.

Post by bisyarin »

Hi.
bisyarin
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 07 Apr 2008, 01:41
Location: Ukraine

===Subj: SEF s

Post by bisyarin »

===
Subj: SEF support for links to phocagallery categories on a search results page.
Now I use this function to generate an URL for the JRoute::_() invocations:


function _buildLink ($id) {
static $sef_enabled;
static $menu_items;
$link = 'index.php?option=com_phocagallery&view=category&id='. $id;

if (!isset ($sef_enabled))
{
$config =& JFactory::getConfig();
$sef_enabled = $config->getValue('sef');
unset ($config);
}

if (!isset ($menu_items))
{
$component =& JComponentHelper::getComponent('com_phocagallery');
$menus =& JApplication::getMenu('site', array());
$menu_items = $menus->getItems('componentid', $component->id);
unset ($component, $menus);
}

foreach ($menu_items as $item)
{
if ($item->query['view'] == 'category' && ($item->query['id'] == $id))
{
if ($sef_enabled)
{
$link = 'index.php?Itemid='.$item->id;
}
else {
$link .= '&Itemid='.$item->id;
}
// return link with first founded menu_item_id.
return $link;
}
}
// Menu items were not found
return $link;
}





===

I shall post about other subjects later.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47916
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

I don't underst

Post by Jan »

I don't understand, why you solve the SEF... there is a method JRoute in Joomla! which solves it...

If SEF is enabled JRoute will use route.php to parse the link and if SEF is disabled, nothing will be transformed ...

but maybe it is necessary to create a direct link ???

Jan
If you find Phoca extensions useful, please support the project
bisyarin
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 07 Apr 2008, 01:41
Location: Ukraine

Yes, it is necessary

Post by bisyarin »

Yes, it is necessary to create a direct link.

I solve the SEF because if it is enabled we are able to get different links depending on the JRoute's $url argument.

For example (SEF is enabled):

First variant:
JRoute::_('index.php?option=com_phocagallery&view=category&id=6&Itemid=4');
returns:
/joomla/cups/termocups/4.html

Second variant:
JRoute::_('index.php?Itemid=4');
returns:
/joomla/cups/termocups.html

That is, if we give to JRoute::_() an $url argument with "itemid" only (just like in the second variant), then it returns to us more readable URL.
Post Reply