We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2140
    • 7 Posts
    Hi
    The highlight did show on my search results page when using AS1.7.1.
    However it doesnt show highlight after I upgraded to Modx 0.9.6.3

    search_results Template:

    <!--search_terms-->
    [!AjaxSearch? &AS_showForm=`0` &ajaxSearch=`0` &hideMenu=`0` &order=`publishedon` &advSearch=`allwords` &highlightResult=`0`!]
    <!--search_terms-->

    CSS (Using this CSS since AS1.7.1)

    /*- AjaxSearch results ---------------------*/


    #ajaxSearch_resultListContainer span.ajaxSearch_highlight {
    background-color: #FFFAC8;
    color: #666666;
    font-style: normal;
    }

    Can anyone solve this problem?
    Thanks.
      • 5811
      • 1,717 Posts
      &highlightResult=`0`
      From the wiki documentation:
      &highlightResult - Create links so that search terms will be highlighted when linked page clicked. (optional). Require the use of the highligth plugin.
        • 10449
        • 956 Posts
        I don’t know why, but I had to manually add those styles in a recent 0.9.6.3 install with AS 1.8.1, otherwise I couldn’t see the highlight on my result pages:

        .AS_ajax_highlight1, .ajaxSearch_highlight1 {
           background-color: #FFFF00;
           color: #000000;
        }
        .AS_ajax_highlight2, .ajaxSearch_highlight2 {
           background-color: #FFFF00;
           color: #000000;
        }
        .AS_ajax_highlight3, .ajaxSearch_highlight3 {
           background-color: #FFFF00;
           color: #000000;
        }
        .AS_ajax_highlight4, .ajaxSearch_highlight4 {
           background-color: #FFFF00;
           color: #000000;
        }
        .AS_ajax_highlight5, .ajaxSearch_highlight5 {
           background-color: #FFFF00;
           color: #000000;
        }
        .AS_ajax_highlight6, .ajaxSearch_highlight6 {
           background-color: #FFFF00;
           color: #000000;
        }


        iirc, these styles were added automatically in previous versions (injected into the HTML head, probably via plugin).