Tracey Goodrich

BT Smart Search /Missing Breadcrumbs

6 posts in this topic

Hi, I really love this search engine but have found a possible bug.

When I enter a search term and press search it opens the results in a Joomla smart search page. Everything works as expected, however my Joomla breadcrumbs module will not activate on the search page.

I can not figure out what is going wrong but have found if I remove the Itemid from the URL and refresh the page my breadcrumbs will show.

For example if I search for salamander my search results page URL looks like http://www.testing.mysite.org/advanced-search?q=salamander&Itemid=101'>http://www.testing.mysite.org/advanced-search?q=salamander&Itemid=101 and results are displayed but no breadcrumbs module.

If i change the URL to http://www.testing.mysite.org/advanced-search?q=salamander breadcrumbs show as expected.

Is this a bug with Joomla or BT Search? Any idea how to fix?

I am using Joomla 3.4.8

Thanks

Share this post


Link to post
Share on other sites

Hi Tracey.

Thanks so much for using our extension.

Please try to create a menu item for Smart Search result page, then public the breadcrumb module on this menu item.

I think the problem wil be solved

Share this post


Link to post
Share on other sites

Hi, thanks but that is how I currently have it set up. The Joomla Smart Search is assigned to a Hidden Menu so it does have a menu ID and it is set to public.

I think I may know why this is happening but I'm not sure how to fix it. I use Rocketthemes Gantry 5 framework and use a homepage layout and a default layout for all other pages. I do not use breadcrumbs on the homepage as they are not needed but do use them on all other pages which are using the default layout.

Since the search page URL has "Itemid=101" appended to it, it is opening the search page using the homepage layout template which doesn't have a breadcrumb module assigned to it.

I've assigned the Smart Search page to the default layout template in Gantry 5 settings and in the menu item's "template style" but it makes no difference because "Itemid=101" is appended to the end of the URL. Menu item 101 is as you know is the homepage id.

As I mentioned in my first post, if I remove "Itemid=101" from the browser's URL and hit enter the page will refresh using the default layout template which has the breadcrumbs.

Is this a BT Search bug or a problem with Joomla?

I am also wondering if I can do a BT Search module override and if possible change the code so that "Itemid=101" is not appended to the URL.

Thank you Kindly :)

Share this post


Link to post
Share on other sites

Hi Again,

Not sure if this will help But I just found this problem only occurs when initiating a search from the homepage.

Apparently the itemid that is appended to the end of the URL will change depending on which website page the BT Search is initiated on. It looks like it is picking up the menu id for the page being viewed.

In order for BT Search to work does it need to add the menu id to the URL?

Share this post


Link to post
Share on other sites

Hi Again,

I'm not much of a coder, i'm more of a code tweaker. Trying to find where this problem occurs, I found if I go into /modules/mod_bt_smartsearch/helper.php and remove lines 126,127 and 128 the problem is resolved. The item id is no longer appended to the URL and the BT Search still seems to function normally from any page on the website. In other words I have found no problems removing this code snippet.

Code removed:


if ($needId) {
$fields .= '<input type="hidden" name="Itemid" value="' . JFactory::getApplication()->input->get('Itemid', '0', 'int') . '" />';
}
[/CODE]

Not sure if there is a down side to removing this except in case of a BT search update.

Could you please advise?

Share this post


Link to post
Share on other sites

I'm really sorry for my late.

I have to solve personal problems last weekend.

For this problem, please try this solution:

Open file /mod_bt_smartsearch/helper.php

Find this line

$uri = JURI::getInstance(JRoute::_($route));

and change to

$uri = JURI::getInstance($route);

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now