We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44920
    • 48 Posts
    Hi,

    i have very basic multi-language site (using Babel) and trying to add some search function to it.

    i have installed SimpleSearch 1.6.1

    and added this to a template which is common for all the pages in all the contexts:

    [[!SimpleSearchForm? &method=`POST`]]
    [[!SimpleSearch]]
    


    i have not altered any of default SimpleSearch snippets nor did i change any properties for SimpleSearch

    in default setup (Use Friendly URLs turned to Yes & default Friendly URL rewrite part in .htaccess commented out) the search does not seem to work at all sad

    There's only
    "There were no search results for the search "". Please try using more general terms to get more results. "
    instead of results even before the search is made.

    if i set Use Friendly URLs to No then i get the search results but only within the context i'm in (which is understandable because other context are not accessible with FURLs set to No)

    is it possible to make SimpleSearch work with Use Friendly URLs = Yes?
    Please help me understand what i'm doing wrong.

    thank you in advance
    be well
    kr [ed. note: krajicek last edited this post 10 years, 8 months ago.]
      MODX Revolution 2.2.8-pl (advanced)

      Extras:
      archivist 1.2.4 | Articles 1.7.1 | Babel 2.2.5 | getpage 1.2.3 | getresources 1.6.0 | quip 2.3.3 | SimpleSearch 1.6.1 | taglister 1.1.7 | TinyMCE 4.3.3 | Wayfinder 2.3.3

      PHP Version 5.6.20-0
      MySQL Version 5.5.31
    • Take a look at the last block "Errors" in http://rtfm.modx.com/extras/revo/simplesearch/simplesearch.simplesearchform
      Maybe this solves your problem?

      Add this to your call to search in more than the current context.
      [[!SimpleSearch? &contexts=`web,myweb2,myweb3`]]
        • 44920
        • 48 Posts
        Quote from: labr1005 at Aug 27, 2013, 01:23 PM
        Take a look at the last block "Errors" in http://rtfm.modx.com/extras/revo/simplesearch/simplesearch.simplesearchform
        Maybe this solves your problem?

        Add this to your call to search in more than the current context.
        [[!SimpleSearch? &contexts=`web,myweb2,myweb3`]]

        Thank you labr1005,

        however "contexts" property will not help because in Friendly URLs scenario the search does not even work for default context.

        also i already read the SimpleSearch online doc - but as i mentioned i use SimpleSearch in default setup (not changed any of the settings or tpl etc.)

        kr
          MODX Revolution 2.2.8-pl (advanced)

          Extras:
          archivist 1.2.4 | Articles 1.7.1 | Babel 2.2.5 | getpage 1.2.3 | getresources 1.6.0 | quip 2.3.3 | SimpleSearch 1.6.1 | taglister 1.1.7 | TinyMCE 4.3.3 | Wayfinder 2.3.3

          PHP Version 5.6.20-0
          MySQL Version 5.5.31
          • 44920
          • 48 Posts
          had another look at the site setup and it looks like this:
          web (context)
            document1
            document2
            Search results (hidden from menus)
          DE (context)
            document3
            document4
          FR (context)
            document5
            document6
          

          Thinking - could be the fact that "Search results" resource is inside the "web" context the source of all problems?
          how could i make the search working cross-contexts?
          assuming (not tested yet) that language specific search could use separate search results resource for each language + "contexts" property for SimpleSearch tag

          have anybody used this or similar scenario?
          or is there better site search extra for this purpose?

          thank you in advance
          kr
            MODX Revolution 2.2.8-pl (advanced)

            Extras:
            archivist 1.2.4 | Articles 1.7.1 | Babel 2.2.5 | getpage 1.2.3 | getresources 1.6.0 | quip 2.3.3 | SimpleSearch 1.6.1 | taglister 1.1.7 | TinyMCE 4.3.3 | Wayfinder 2.3.3

            PHP Version 5.6.20-0
            MySQL Version 5.5.31
            • 45069
            • 22 Posts
            Hi Krajicek,

            I am also very interested in this subject. Is there anybody which may give some details about this?

            Regards,
            ZK
              • 45069
              • 22 Posts
              Hi,

              Found a solution which allow to have for each context his own language specific search.
              For each context I created the 'Search result' page.
              Inside each context I've added as context setting: thisSearchResultPageId
              That setting has as value the ID of the context corresponding search result page.

              In my template I changed the simple search part and now looks like:

              [[!SimpleSearchForm? &method=`POST` &landing=`[[++thisSearchResultPageId]]`]]

              Now the search searches in the corresponding context where that landing page belongs to.
              This means for example that if you search in German (DE) site you get results from DE; if you search in EN you get pages from EN a.s.o.

              If you want to show also search results from other contexts you may use:
              <p>[[!SimpleSearch? &contexts=`en,de`]]</p>

              This works for friendly URLs also.

              I would be happy to see more solutions and other ways to implement this.

              Regards,
              kubraniec [ed. note: kubraniec last edited this post 10 years, 8 months ago.]