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

    nee some magic. Somehow i can’t get IE (6 and 7) to work with AS
    I use original, no modifications.

    here is my template:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <base href="http://intranet2008/">
    <meta http-equiv="Content-Type" content="text/html; charset=[(mod2_charset)]" /> 
    <title>MODX AS TEST</title> 
      <link rel="stylesheet" href="assets/templates/modxhost/search.css" type="text/css" media="print" />
    	<script type="text/javascript" src="manager/media/script/mootools/mootools.js"></script> 
    </head> 
    <body id="type-b"> 
      <div id="header"> 
    
    <div id="search"> 
           [!AjaxSearch? &AS_showResults=`0` &AS_landing=`8` &showMoreResults=`1` &moreResultsPage=`17` &debug=`3`!]
    </div>
    </div>
    </body> 
    </html>


    Here is the css
    #ajaxSearch_subSearch{
    	padding: 3px 2px 2px 2px;
      margin: 5px 0 10px 0;
      list-style: none;
    }
    #ajaxSearch_radio {
    	background:#FFFFFF;
    	font-size:0.8em;
    	margin:2px 0;
    	padding:3px 1px 2px 1px;
    }
    #ajaxSearch_select {
    	background:#FFFFFF;
    	height:auto;
    	width: 150px;
    	font-size:0.8em;
    	padding: 3px 1px 2px 1px;
    	border: 2px inset gray;
    }
    #search #ajaxSearch_form, #search form {
      position:absolute;
      top: 10px;
      right: 0;
    }
    #ajaxSearch_form fieldset{
    float: left;
    }
    
    #searchClose{
    margin:8px 0 0 0;
    }
    
    #ajaxSearch_intro {
    margin: 10px 0 15px 0;
    }
    
    #ajaxSearch_input {
    	width: 280px;
    	background: #FFFFFF;
    	font-size: 0.8em;
    	padding: 3px 1px 2px 1px;
    	border: 2px inset gray;
    }
    
    #ajaxSearch_submit {
      height: 2em;
    	background: #6F9303;
    	text-transform: lowercase;
    	font-size: 0.9em;
    	font-weight: bold;
    	color: #FFFFFF;
    }
    
    #ajaxSearch_output {
      font-size: 90%;
    	background-color: #EFEFEF;
    	border: 1px solid #6F9303;
      position: absolute;
      top: 40px;
      right: 0;
      width: 480px;
    	z-index: 1;
    	padding: 5px;
    	margin: 5px 0 15px 0;
    }
    
    .ajaxSearch_paging {
      display: block;
      margin: 5px 0 10px;
    }
    .AS_ajax_result {
      color: #444;
      margin-bottom: 3px;
    }
    .AS_ajax_resultLink {
      text-decoration: underline;
    }
    .AS_ajax_resultDescription, .ajaxSearch_resultDescription{
      color: #555;
      padding: 2px;
    }
    .AS_ajax_resultsIntroFailure{
      padding: 3px;
    }
    .AS_ajax_highlight1, .ajaxSearch_highlight1{
      color : #CC0000;
      padding: 0;
      font-weight: bold;
    }
    .AS_ajax_highlight2, .ajaxSearch_highlight2{
      color : #CB53DF;
      padding: 0;
      font-weight: bold;
    }
    .AS_ajax_highlight3, .ajaxSearch_highlight3{
      color : #DF53B5;
      padding: 0;
      font-weight: bold;
    }
    .AS_ajax_highlight4, .ajaxSearch_highlight4{
      color : #DF5380;
      padding: 0;
      font-weight: bold;
    }
    .AS_ajax_highlight5, .ajaxSearch_highlight5{
      color : #A453DF;
      padding: 0;
      font-weight: bold;
    }
    .AS_ajax_highlight6, .ajaxSearch_highlight6{
      color : #53ADDF;
      padding: 0;
      font-weight: bold;
    }
    .AS_intro { display: none;}
    
    .AS_ajax_resultImage img{
      margin:10px 140px 20px 140px;
    }
    .ajaxSearch_resultImage img{
      margin:10px 20px 20px 20px;
    }


    anf finaly the debug log.
    [12-Dec-08 04:24:50]  AjaxSearch 1.8.1 - Php5.2.3 - MySql 5.0.45-log
    [12-Dec-08 04:24:50]  AjaxSearch - Configuration file default : 
    <?php
    // For a global parameter initialisation use the following syntax $__param = 'value';
    // To overwrite parameter snippet call use $param = 'value';
    
    // StripInput user function. 
    // Uncomment and complete the core function and choose your own function name
    // string functionName(string searchstring)
    // functionName : name of stripInput function passed as &stripInput parameter
    // searchstring : string php variable name as searchString input value
    // advSearch : string advSearch variable as advSearch parameter and return value
    // return the filtered searchString value
    /*
    function myStripInput($searchString, &$advSearch){
      $advSearch = 'exactphrase';
      return $searchString;
    }
    */
    // StripOutput user function
    // Uncomment and complete the core function and choose your own function name
    // string functionName(string results)
    // functionName : name of stripOutput function passed as &stripOutput parameter
    // results : string php variable name as results
    // return the filtered results
    /*
    function myStripOutput($results){ 
    
      return $results;
    }
    */
    // searchWordList user function
    // Uncomment and complete the core function and choose your own function name
    // string functionName()
    // functionName : name of searchWordList function passed as &searchWordList parameter
    // return a comma separated list of words
    /*function searchWordList($params){ 
    
      switch($params[0]){ 
        case '61':
          $list = "primary,school,education,children,teacher,africa,litteracy,bicycle";
          break;         
        case '62':
          $list = "primaire,école,éducation,enfants,professeur,afrique,littérature,bicyclette";
          break; 
      }
      return $list;
    }
    */
    ?>
    [12-Dec-08 04:24:50]  AjaxSearch - User configuration - Before parameter checking : Array
    (
        [config] => default
        [version] => 1.8.1
        [debug] => 3
        [language] => nederlands
        [ajaxSearch] => 1
        [advSearch] => oneword
        [whereSearch] => content|tv
        [subSearch] => 5,1
        [withTvs] => 
        [order] => publishedon,pagetitle
        [rank] => pagetitle:100,extract
        [minChars] => 3
        [AS_showForm] => 1
        [resultsPage] => 0
        [grabMax] => 10
        [extract] => 1:content,description,introtext,tv_content
        [extractLength] => 200
        [extractEllips] => ...
        [extractSeparator] => <br />
        [formatDate] => d/m/y : H:i:s
        [highlightResult] => 1
        [pageLinkSeparator] =>  | 
        [AS_landing] => 8
        [AS_showResults] => 0
        [idType] => parents
        [parents] => 
        [documents] => 
        [depth] => 10
        [hideMenu] => 2
        [hideLink] => 1
        [filter] => 
        [tplLayout] => @FILE:assets/snippets/ajaxSearch/templates/layout.tpl.html
        [tplResults] => @FILE:assets/snippets/ajaxSearch/templates/results.tpl.html
        [tplResult] => @FILE:assets/snippets/ajaxSearch/templates/result.tpl.html
        [tplPaging] => @FILE:assets/snippets/ajaxSearch/templates/paging.tpl.html
        [stripInput] => defaultStripInput
        [stripOutput] => defaultStripOutput
        [searchWordList] => 
        [breadcrumbs] => 0
        [tvPhx] => 0
        [clearDefault] => 0
        [jsClearDefault] => assets/snippets/ajaxSearch/js/clearDefault.js
        [ajaxSearchType] => 0
        [ajaxMax] => 6
        [showMoreResults] => 1
        [moreResultsPage] => 17
        [opacity] => 1
        [tplAjaxResults] => 
        [tplAjaxResult] => 
        [jscript] => mootools
        [addJscript] => 1
        [jsMooTools] => manager/media/script/mootools/mootools.js
        [jsJquery] => assets/snippets/ajaxSearch/js/jQuery/jquery.js
    )
    
    [12-Dec-08 04:24:50]  AjaxSearch - tplResult template @FILE:assets/snippets/ajaxSearch/templates/result.tpl.html : <div class="[+as.resultClass+]">
      <a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.longtitle+]">[+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>
    `+]
    [+as.breadcrumbsShow:is=`1`:then=`
      <span class="[+as.breadcrumbsClass+]">[+as.breadcrumbs+]</span>
    `+]
    </div>
    [12-Dec-08 04:24:50]  AjaxSearch - tplResults template@FILE:assets/snippets/ajaxSearch/templates/results.tpl.html : [+as.noResults:is=`1`:then=`
      <div class="[+as.noResultClass+]">
        [+as.noResultText+]
      </div>
    `:else=`
      <p class="ajaxSearch_resultsInfo">[+as.resultInfoText+]</p>
      [+as.paging+]
      [+as.listResults+]
      [+as.paging+]
    `+]
    [12-Dec-08 04:24:50]  AjaxSearch - tplResult template@FILE:assets/snippets/ajaxSearch/templates/layout.tpl.html : [+as.showForm:is=`1`:then=`
    <form [+as.formId+] action="[+as.formAction+]" method="post">
        <fieldset>
    		<input type="hidden" name="advSearch" value="[+as.advSearch+]" />
        <label for="ajaxSearch_input">
          <input id="ajaxSearch_input" class="cleardefault" type="text" name="search" value="[+as.inputValue+]"[+as.inputOptions+] />
        </label>
        <label for="ajaxSearch_submit">
          <input id="ajaxSearch_submit" type="submit" name="sub" value="[+as.submitText+]" />
        </label>
        </fieldset>
    </form>
    `+]
    [+as.showIntro:is=`1`:then=`
    <p class="ajaxSearch_intro" id="ajaxSearch_intro">[+as.introMessage+]</p>
    `+]
    [+as.showResults:is=`1`:then=`
    [+as.results+]
    `+]
    


    at least 1 option he should find.


    With FF the log has the results...

    spend my whole day with this, but i can’t find the tree in this forrest...
    Has anyone a good idea?

    By the way, the 2 icons appear, and after searching i notice a empty row.
      no mail. no icq, no aim, no msn, no yim, no sms, no phone, no fax, no telex, no satellite.... just yell smiley
      • 5811
      • 1,717 Posts
      [!AjaxSearch? &AS_showResults=`0` &AS_landing=`8` &showMoreResults=`1` &moreResultsPage=`17` &debug=`3`!]

      With this call, you choose the ajax mode (default). So &AS_landing=`8` is useless.
      Otherwise remove
      &AS_showResults=`0`
      because by default this value is set to 1 and needed to display results. See the AS demo site for examples.

      spend my whole day with this, but i can’t find the tree in this forrest...
      In this case, ask for somebody with the right machete wink
        • 30625
        • 19 Posts
        Gooed morning,

        wel to my shame, the two &AS_showResults=`0` &AS_landing=`8``where not in my original.
        but i tested a long a lot and forgot to get them out.

        still no luck.

        by the way, i tested [!AjaxSearch!] which should also work but it doesnt.

        The demosite i checked. i even used the code from there.
        with that code it works, but then i don’t use [!AjaxSearch!] but
        <form id="ajaxSearch_form"  action="index.php?id=8" method="post">
            <fieldset>
        	<input type="hidden" name="advSearch" value="oneword" />
        	<label for="ajaxSearch_input">
        	<input id="ajaxSearch_input" class="cleardefault" type="text" name="search" value="Zoek hier..." onfocus="this.value=(this.value=='Zoek hier...')? '' : this.value ;" />
        	</label>
        	<label for="ajaxSearch_submit">
        	<input id="ajaxSearch_submit" type="submit" name="sub" value="Zoek!" />
        	</label>
            </fieldset>
        </form>
        <div id="ajaxSearch_output"></div>


        if i put this code in my template and add also the line:
        <script type="text/javascript" src="assets/snippets/ajaxSearch/js/ajaxSearch.js"></script>

        and add the configs in there i get it to work huh
          no mail. no icq, no aim, no msn, no yim, no sms, no phone, no fax, no telex, no satellite.... just yell smiley