• Home
  • Get help
  • Ask a question
Last post 21 hours 36 min ago
Posts last week 81
Average response time last week 4 hours 29 min
All time posts 67915
All time tickets 10498
All time avg. posts per day 20

Helpdesk is open from Monday through Friday CET

Please create an (free) account to post any question in the support area.
Please check the development versions area. Look at the changelog, maybe your specific problem has been resolved already!
All tickets are private and they cannot be viewed by anyone. We have made public only a few tickets that we found helpful, after removing private information from them.

#1244 – Make sef url for custom component

Posted in ‘sh404SEF’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Friday, 30 October 2015 12:26 UTC
businesspages
Hi,

I have installed sh404SEF component and it's related all plugins and its working very well with default components but its not working with custom component.
So, what should i do make sef url for custom component? and is there any setting to config custom component?

for example,
Non-sefulr: http://xxxx.ie/demo/index.php?option=com_businessd&Itemid=259&catId=264&view=listing
and i want to make sefurl as per below,
http://xxxx.ie/demo/clothes-shops-baby-and-kids
So, could you please guide me how can i do that?

Thanks you
Friday, 30 October 2015 12:34 UTC
wb_weeblr
Hi

You need to create a plugin. This is a php file.

- called com_business.php
- located in /components/com_business/sef_ext
- in it, you build up the URLs based on query variables. You can use as an example the plugins that comes with sh404SEF for the standard Joomla components. Those ones are located in /components/com_sh404sef/sef_ext.

Rgds
 
Friday, 30 October 2015 12:50 UTC
businesspages
Thanks for prompt reply,

I will try it, if i have any query then will contact to you
Friday, 30 October 2015 12:53 UTC
wb_weeblr
ok. We normally only provide support for using our extension, not for developers, but programming those plugins is really simple (because you don't have to worry about decoding URLs, only encoding them). So if you know your com_business component, should be pretty easy.

Rgds
 
Monday, 02 November 2015 07:47 UTC
businesspages
Hello,

I have created com_businessd.php file and put on /components/com_business/sef_ext/ dir.

In that file, i have set listing view, but listing view urls doesn't convert into sefurl at real-time and it works as non-sefurl.

Here i have attached .php file which i created, So, Can you please tell me what i missed in that file?

Thanks in advance
Monday, 02 November 2015 07:47 UTC
businesspages
Monday, 02 November 2015 10:13 UTC
wb_weeblr
Hi

Well, if the file is called com_businessd.php, it can't work.

I quickly looked into it:

$view = JREQUEST::getVar('view', null);
$catId = JREQUEST::getVar('catId', null);
$Id = JREQUEST::getVar('Id', null);
$countyId = JREQUEST::getVar('countyId', null);
$town = JREQUEST::getVar('town', null);


Please look at the other plugins. you're not building URLs for the currently requested URL.

use, just like the other plugins:
$view = empty($view) ? '' : $view;
$catId= empty($catId) ? '': $catId;


Rgds
 
Tuesday, 03 November 2015 07:14 UTC
businesspages
A lot thanks for guide me.

Now, its working fine but there is minor issue with form submit. when i submit form data at that moment its not convert into sefurl at real-time. its post as a non-sefurl like,

http://xxxx/index.php?option=com_businessd&view=listing&Itemid=124&catId=264&countyId=33&town[]=4095&town[]=4119&town[]=4120&btnsearch=btnsearch&submit=Search¤t_lat=¤t_long=

In plugin file my coding is,
case 'listing':
  
 	$title[]=getCat($catId);
	if(isset($countyId) && $countyId!="")
	{
		$title[]=getCountyNm($countyId);
		shRemoveFromGETVarsList('countyId');
	}
	if(isset($town) && !empty($town))
	{
		foreach($town as $twnId)
		{
			$title[]=getTownNm($twnId);
		}
		shRemoveFromGETVarsList('town');
		shRemoveFromGETVarsList('submit');
		
	}
	
	 shRemoveFromGETVarsList('view');
	 shRemoveFromGETVarsList('catId');
	 if($current_long!="" && $current_lat!=""){
		shRemoveFromGETVarsList('current_lat');
		shRemoveFromGETVarsList('current_long');
	 }
    break;

Here i printed $title variable and it looks array like,
Array ( [0] => Clothes Shops - Baby and Kids [1] => CoAntrim [2] => Antrim [3] => Ballymena [4] => Ballymoney ) 

And i want to make sefurl like,
http://xxxx/baby-and-kids-shops/coantrim/antrim/ballymena/ballymoney

So, Can you please tell me how can i make sefurl at real-time when i submit form data?

Thank you
Tuesday, 03 November 2015 09:26 UTC
wb_weeblr
Hi

I'd guess the problem is not in your plugin or sh404SEF. Is your form using JRoute?

Rgds
 
Tuesday, 03 November 2015 13:09 UTC
businesspages
Hi,

sh404SEF is not working with external file(which located on root dir), this file used to filter result via ajax. and in this file i have set link as per below,
JRoute::_('index.php?option=com_businessd&view=detailview&Itemid=259&catId='.$catId.'&Id='.$Id)

and it makes sefurl like,
http://xxxx/details-view?view=detailview&catId=114&Id=160865

But it should be make like,
http://xxxx/beauty-products/abahnacouk


Here i have attached one of root file, so can please guide me what i have missed on this file?

Thank you,
Tuesday, 03 November 2015 14:09 UTC
wb_weeblr
Hi

Sorry, no. I can't provide support for you building your own custom plugin, especially if it's for a custom component. That's totally outside of support scope.

If I understand correctly what you say, you want to use an external PHP file, for ajax? I'm sure this would break sh404SEF indeed.

if you want to do ajax within Joomla, there's a dedicated Joomla API for that (using com_ajax), very well described in Joomla documentation.

sh404SEF will not support any such external file.

Rgds
 
Wednesday, 18 November 2015 05:34 UTC
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.