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


    im am trying to create a search that returns its results in the form of

    Document Alias(that links to whichever page)>page description

    ive had a search through a lot of the posts but cant track down something similar..

    is it as simple as im calling things wrong or will i need to change the JS or?..

    any help would be really appreciated (as always/usual smiley )

    ddools
      • 5811
      • 1,717 Posts
      im am trying to create a search that returns its results in the form of

      Document Alias(that links to whichever page)>page description
      Do you mean that you want from the displayed results a link from each pagetitle to the document but rather a link with ?id=xx you would like a link with the alias of the document. Is it a correct understanding of your request ?
        • 6852
        • 39 Posts
        emm yes i think so,,, but just on a visual basis

        so far as i can tell the default is something like:



        xx pages found for "searchedterm"
        |||pagiation||||

        >Page Title <<where this is a link that can be linked to that page>>
        >description
        >opening paragraph of the page....



        where as what i was hoping to do was



        xx pages found for "searchedterm"
        |||pagiation||||

        >Page Alias <<where this is a link that can be linked to that page>>
        >description
        >opening paragraph of the page....



        so the exact same functionality, but slightly different in appearance wise

          • 5811
          • 1,717 Posts
          I will add the field "alias" in the list of searchable fields (like ’pagetitle’,’longtitle’,’description’,’introtext’,’content’) to allow the displaying of the alias if required.

          For the moment, if you can’t wait the official delivery of the release 1.8, download the 1.8 beta 1 from this post and in the file class/search.class.inc.php, in the function initSearchContext() , somewhere around the line 198, change:
                        'searcheable' => array('pagetitle','longtitle','description','introtext','content'),
          by
                        'searcheable' => array('pagetitle','longtitle','description','alias','introtext','content'),
          and then define your own result template (tplresult ou tplAjaxResult depending of the ajaxSearch mode you use) as follow (tplAjaxResult example):
          <div class="[+as.resultClass+]">
            <a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.aliasShow:is=`1`:then=`[+as.alias+]`:else=`[+as.pagetitle+]`+]</a>
          [+as.descriptionShow:is=`1`:then=`
            <span class="[+as.descriptionClass+]">[+as.description+]</span>
          `+]
          [+as.extractShow:is=`1`:then=`
            <div class="[+as.extractClass+]"><p>[+as.extract+]</p></div>
          `+]
          </div>
          with: [+as.aliasShow:is=`1`:then=`[+as.alias+]`:else=`[+as.pagetitle+]`+], if the alias exists it will be used, otherwise pagetitle will be used.



            • 6852
            • 39 Posts
            wow, thanks very much coroico,


            that’s impressively amazing,,,, thanks so much for your help,,,, ill try it now

            ddools