Page 1 of 1

Hello!Thank yo

Posted: 07 Apr 2008, 01:44
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?

Hi, the problem is t

Posted: 07 Apr 2008, 14:36
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

Hello again!Th

Posted: 07 Apr 2008, 21:10
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)

Sorry but I have no

Posted: 07 Apr 2008, 22:35
by Jan
Sorry but I have no rights to download the file...

Posted: 07 Apr 2008, 23:27
by bisyarin

hmmm, my question is

Posted: 08 Apr 2008, 08:05
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

Hi.

Posted: 09 Apr 2008, 02:47
by bisyarin
Hi.

===Subj: SEF s

Posted: 09 Apr 2008, 02:48
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.

I don't underst

Posted: 09 Apr 2008, 08:04
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

Yes, it is necessary

Posted: 09 Apr 2008, 11:36
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.