Search not working when at PageNotFound.aspx

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
8/22/2013 12:03:06 PM
Gravatar
Total Posts 40

Search not working when at PageNotFound.aspx

I just noticed when using my own sites (version 2.3.9.8, MS SQL, .NET 4.0), and even on the mojo demo site, that the search isn't working when at PageNotFound.aspx.

Reproduction steps:

  1. Eg, visit http://demo.mojoportal.com/blah
  2. Type "mojoPortal" in either search box and click the appropriate search icon/button
  3. No results appear, even though there are results for that term when using the search page

Not a huge deal, but I figured I'd apprise you of it.  

Thanks Joe/others...
Shaun

8/27/2013 12:34:44 PM
Gravatar
Total Posts 18439

Re: Search not working when at PageNotFound.aspx

Hi Shaun,

I'm not clear whether you are talking about the mojoportal search input for site search that is shown in the header of some skins or if you mean the google site search on the 404 page that is wired up by javascript.

I tested using the mojoportal search input by using the art41-bookheader skin which has the input and it did not work. The problem was that we cannot really process the postback and redirect while also returning the 404 status code which that page was designed to do. 

So I fixed it just now with a javascript solution for the redirect and you can fix it in your copy of PageNotFound.aspx in the root.

The existing javascript is like this to enable the google search helper

<script type="text/javascript">
    var GOOG_FIXURL_LANG = '<%= CultureCode %>';
    var GOOG_FIXURL_SITE = '<%= SiteNavigationRoot %>';

</script>

add to that script block to include the extra stuff as shown here which looks for the mojo search input and button:

<script type="text/javascript">
    var GOOG_FIXURL_LANG = '<%= CultureCode %>';
    var GOOG_FIXURL_SITE = '<%= SiteNavigationRoot %>';

    var searchInput = $(".searchpanel input[type=text]");
    var searchButton = $(".searchpanel input[type=submit]");
    if ((searchInput) && (searchButton)) {
        searchButton.click(function () {
            window.location = GOOG_FIXURL_SITE + "/SearchResults.aspx?q=" + searchInput.val();
            return false;
        });
    
    }
    
</script>

 

On the demo site the google search does not work because it is only searching the demo site not the web, but it has no results because I have told google NOT to index the demo site at all via the robots.txt file because it would just mess up the seo for this site to have our demo site come up in search results. So even if matching content was entered in the google search on the demo 404 page it will not find anything because it is not indexed by google.

Thanks,

Joe

You must sign in to post in the forums. This thread is closed to new posts.