We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21800
    • 174 Posts
    @ atma and the other AS friends

    sorry, both of your suggestions don’t work for me, not even in combination. Does that mean, the collation_server has to be utf8 too? (see Reply #214) or what could have been run the wrong way?

    (Additional info: db fields are set to utf8 too, Editor is set to raw entity coding, modx is set to utf-8 coding, pages are ok in look and html’s show original chars i.e. ä)

    Looking via phpMyAdmin into a db field the word "Geräte" is written "Geräte" on the (utf-8 coded) page, in html source it reads there "Ger%C3%83%C2%A4te".

    So, if I search for "Geräte" AS will find (no highlight in the page and "Geräte" in the search term message).

    ???
      • 2364
      • 73 Posts
      Quote from: nos at Jun 01, 2007, 10:20 AM

      I’m not allowed to change server configs. The Hoster surely doesn’t want to ("latin1_swedish_ci is a standard config in europe." he says).
      but you have permission to phpMyAdmin... At the main page of phpMyAdmin this field are readonly?

      After you will create (edit) page MODx and will receive the same result in phpMyAdmin, AjaxSearch too will earn normally... I hope rolleyes
      So, if I search for "Geräte" AS will find (no highlight in the page and "Geräte" in the search term message).
      What about CSS:
      .AS_ajax_extract{xxx;}
      .AS_ajax_highlight{xxx};
      .ajaxSearch_highlight {xxx;}
      .ajaxSearch_highlight1 {xxx;}
      etc?
        • 21800
        • 174 Posts
        thanks for reply atma,
        I can not reach this page in phpMyAdmin. I’ve got three possible dbs from the hoster - creating a new db is only possible from a confixx interface. phpMyAdmin states: creating new db - no rights, so it’s readonly - yes.

        sql statement:
        SHOW VARIABLES LIKE ’character_set%’;
        SHOW VARIABLES LIKE ’collation%’;
        results in
        collation_connection utf8_general_ci
        collation_database utf8_general_ci
        collation_server latin1_swedish_ci <--- I can not change
        (MySQL 5.0.32-Debian_7etch1-log)

        as for AS highligting css): search without special chars is running fine.
          • 22303 MODX Staff
          • 10,725 Posts
          @nos: you do not need to change the server value. You just need utf8 as the database_connection_charset value so that the MODx db connection knows what charset your database (and the tables in it) actually has. That’s what SET CHARACTER SET statement does; it switches the MySQL client connection to the proper charset/collation for whatever queries follow it.
            • 21800
            • 174 Posts
            @opengeek
            I agree and see it this way too. So why AS doesn’t work accordingly? I did this changes dicussed here (see replies below) but nothing changes in AS output.
            sad
              • 16534
              • 47 Posts
              I’m trying to use this but having problems

              - If I add the search somewhere with another snippet, it doesn’t seem to want to give me any results (when they work before I added the other snippet)

              - How can I make the results come out BELOW the search bar? I’ve looked everywhere but cannot find how to do it.
                • 1535
                • 84 Posts
                Hi.
                After upgrading to 0.9.6. and AS 1.6 the pages does not validate as XHTML Strict anymore.

                Here is the error from the validator:
                Error  Line 101 column 32: document type does not allow element "label" here;
                missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.
                
                			<label for="ajaxSearch_input">


                The HTML looks like this:
                        <div class="searchform">
                		<form action="index.php?id=8" method="post">
                			<label for="ajaxSearch_input">
                				<input id="ajaxSearch_input" type="text" name="search" value="Søk her..." onfocus="this.value=(this.value=='Søk her...')? '' : this.value ;" />
                			</label>
                			<label for="ajaxSearch_submit">
                
                				<input id="ajaxSearch_submit" type="submit" name="sub" value="Søk!" />
                			</label>
                		</form>


                This is my AS call:

                [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`8`&extract=`1` &showMoreResults=`1` &extract=`0`&AS_showResults=`0!]


                Any ideas?

                Cheers,

                Andreas
                  • 23050
                  • 1,842 Posts
                  About the validation, you should try this :

                          <div class="searchform">
                  		<form action="index.php?id=8" method="post">
                  			<label for="ajaxSearch_input">label for input with ajaxSearch_input id </label>
                  				<input id="ajaxSearch_input" type="text" name="search" value="Søk her..." onfocus="this.value=(this.value=='Søk her...')? '' : this.value ;" />
                  			
                  			<label for="ajaxSearch_submit">label for input with ajaxSearch_submit id </label>
                  
                  				<input id="ajaxSearch_submit" type="submit" name="sub" value="Søk!" />
                  			
                  		</form>


                  label should never contains an input... in fact, label is used to bind a text for the input and the input itself. Thanks to label, when you click on the label, the cursor is put inside the input (or checks the radio, for ex)

                  Hope I’m clear :p
                    • 1535
                    • 84 Posts
                    Hi and thanks for the quick reply.

                    I understand what you are saying, but this HTML is generated by AjaxSearch, I only have the call in my template for the form.

                    As such, I am not sure how or where to try the fix you suggest, as this seems to be an issue within the snippet code.

                    Earlier, there was a switch to enable XHTML Strict in the snippet, but it is gone in this version.

                    Cheers,

                    Andreas
                      • 23050
                      • 1,842 Posts
                      Ah ok !

                      You can change your templates in : assets/snippets/AjaxSearch/includes/templates.inc.php. That’s what I did wink

                      This discussion is closed to further replies. Keep calm and carry on.