Support Forums

Support Offline : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

SP Portfolio links no good

Featured Lock Resolved
SP Portfolio module is very nice but I discovered a problem. It generate links like this: www.exemple.com/index.php/component/content/article/abc/abc?Itemid=0 and not http://www.exemple.com/page/abc.

This means that - at least in my case - not all modules/extensions associated with that page are shown. So the module is useless for me as it is now. Can this problem be solved? I guess it would be good for everybody to have correct and SEO-friendly links.

13 Answers

marcel Rymenhout

More than a month ago #Permalink
Hi i had the same problem i am no Joomla geek but i put to geather a solution

open modules/mod_sp_portfolio/helper.php and do the following

$catids = self::categories($params->get('catid'));


add the following line after

$mcatids = $params->get('catid');



find

foreach ($items as &$item) {


add this line above

$categoryName   = strtolower(modSPPortfolioJHelper::getCategoryName($mcatids));


find the following lines

$nonsefurl 	= ContentHelperRoute::getArticleRoute($item->slug, $item->catslug);
$nonsefurl = preg_replace('/Itemid=(.+)/', 'Itemid=0', $nonsefurl );
$item->link = JRoute::_($nonsefurl);


comment them out like this

//$nonsefurl 	= ContentHelperRoute::getArticleRoute($item->slug, $item->catslug);
//$nonsefurl = preg_replace('/Itemid=(.+)/', 'Itemid=0', $nonsefurl );
//$item->link = JRoute::_($nonsefurl);


add this lines after

$item->link         = 'index.php/'. $categoryName  .'/'.$item->category_alias.'/'.$item->alias;


find

[code type="xml"] //Get categories
public static function categories($parent){
$db = JFactory::getDBO();
$query = "SELECT id FROM #__categories WHERE `parent_id`='" . $parent. "' AND `published`='1'";
$db->setQuery($query);
$catids = $db->loadColumn();
return $catids;
}


add this after

  //Get category name
public static function getCategoryName($catIds = array()){
if($catIds && count($catIds) == 1){
$query = 'SELECT title FROM #__categories'
.' WHERE extension="com_content" AND id='.(int)$catIds[0];
$db = JFactory::getDbo();
$db -> setQuery($query);
if($db -> query()){
$rows = $db -> loadObject();

if($rows)
return $rows -> title;
}
}
return false;
}



this worked for me maybe not the best solution but it works

hope this helps

Carst Komdeur

More than a month ago #Permalink
Hi Marcel Rymenhout

This seems to change the URL in a much more SEO friendlier way. BUT, the category name which is shown, isn't the correct one in my case. It takes the subcategory name, but it should be the parent category to create the right URL. Any idea?

Regards, Carst

yehi co

More than a month ago #Permalink
marcel Rymenhout wrote:

Hi i had the same problem i am no Joomla geek but i put to geather a solution

open modules/mod_sp_portfolio/helper.php and do the following

$catids = self::categories($params->get('catid'));


add the following line after

$mcatids = $params->get('catid');



find

foreach ($items as &$item) {


add this line above

$categoryName   = strtolower(modSPPortfolioJHelper::getCategoryName($mcatids));


find the following lines

$nonsefurl 	= ContentHelperRoute::getArticleRoute($item->slug, $item->catslug);
$nonsefurl = preg_replace('/Itemid=(.+)/', 'Itemid=0', $nonsefurl );
$item->link = JRoute::_($nonsefurl);


comment them out like this

//$nonsefurl 	= ContentHelperRoute::getArticleRoute($item->slug, $item->catslug);
//$nonsefurl = preg_replace('/Itemid=(.+)/', 'Itemid=0', $nonsefurl );
//$item->link = JRoute::_($nonsefurl);


add this lines after

$item->link         = 'index.php/'. $categoryName  .'/'.$item->category_alias.'/'.$item->alias;


find

[code type="xml"] //Get categories
public static function categories($parent){
$db = JFactory::getDBO();
$query = "SELECT id FROM #__categories WHERE `parent_id`='" . $parent. "' AND `published`='1'";
$db->setQuery($query);
$catids = $db->loadColumn();
return $catids;
}


add this after

  //Get category name
public static function getCategoryName($catIds = array()){
if($catIds && count($catIds) == 1){
$query = 'SELECT title FROM #__categories'
.' WHERE extension="com_content" AND id='.(int)$catIds[0];
$db = JFactory::getDbo();
$db -> setQuery($query);
if($db -> query()){
$rows = $db -> loadObject();

if($rows)
return $rows -> title;
}
}
return false;
}



this worked for me maybe not the best solution but it works

hope this helps


I have Joomla 3, the solution did not help me.
There is another solution?
Thanks

joey26

More than a month ago #Permalink
Hello,

Is there any other solution to above issue with sp_portfolio links not working.
As I have tried this and it just doesn't show any of my portfolio items.

Ehsan Riyadh

More than a month ago #Permalink
Ok, we will update the module as soon as possible. Thanks for patients.

joey26

More than a month ago #Permalink
Please let us know when the sp_portfolio module has been updated.

Many thanx

Kawshar Ahmed - Senior Staff

More than a month ago #Permalink
Please keep in touch with us in facebook or twitter to know as soon as its available.
Thanks

Danilo Daba

More than a month ago #Permalink
Hello Support,

You already have the solution?

I have the same problem, I use Joomla 3.3.1.

Kawshar Ahmed - Senior Staff

More than a month ago #Permalink
Hi, we are in leave for 10 days. We will fix as soon as we back to office.

Ricardo

More than a month ago #Permalink
Hi has this been solved? I'm trying to find a solution for this.

Thanks

pepperstreet

More than a month ago #Permalink
(Following…)

Ricardo

More than a month ago #Permalink
Anyone there??

Kawshar Ahmed - Senior Staff

More than a month ago #Permalink
Hi, we've released a new version of this module. Well, you have to create a menu item linked to the parent category to make the URL look good.

Thanks


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Leaderboard (30 days)

Paul Frankowski

Paul Frankowski

Total Accepted Answers: 192
Sifat

Sifat

Total Accepted Answers: 102
Toufiq

Toufiq

Total Accepted Answers: 31
Rifat Wahid Alif

Rifat Wahid Alif

Total Accepted Answers: 9
Al Mamun

Al Mamun

Total Accepted Answers: 4

100+

Templates

200,000+

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us