2020-05-12, 19:28:11
(This post was last modified: 2020-06-07, 22:41:12 by Alan-A.
Edit Reason: Added code for search form & PHP warning
)
Hello,
I'm using i18n and i18n search in my web-site and after after carrying out a search from either the search form or the tag cloud the page is loaded with a mixture of languages. This only happens when I call the search with my site's second language (English) active.
The search results page is loaded correctly - i.e. the English version suchergebnisse_en - but the following happens:
I'm calling my language menu in my header.inc.php template using:
I'm calling the search form in my header.inc.php file using, for example:
I'm calling the tag cloud in a language-specific component with :
The links in the tag cloud are rendered correctly - pointing to, for example:
- http://.../getsimple/suchergebnisse_en/?tags=translation
My search result pages are language-specific (i.e. suchergebnisse & suchergebnisse_en) and I'm calling the results with:
The searchresultrenderer component has:
There are no errors in the errorlog.txt file.
I am however getting a warning:
Could someone give me a hint about what I'm doing wrong?
You can see this on www.alan-amos.de
Many thanks in advance
Alan
I'm using i18n and i18n search in my web-site and after after carrying out a search from either the search form or the tag cloud the page is loaded with a mixture of languages. This only happens when I call the search with my site's second language (English) active.
The search results page is loaded correctly - i.e. the English version suchergebnisse_en - but the following happens:
- $language changes to German. This in turn means that:
[**]the language selection menu changes to the site's first language (German)
[**]the language of the search form and tag cloud change to German
- The i18n Navigation menus remain in English.
I'm calling my language menu in my header.inc.php template using:
Code:
<?php if ($language == 'en') { ?>
English
<?php } else { ?>
<a href="<?php echo htmlspecialchars(return_i18n_setlang_url('en')); ?>">English</a>
<?php } ?>
I'm calling the search form in my header.inc.php file using, for example:
Code:
<?php if ($language == 'en') {
get_i18n_search_form(array('slug'=>'suchergebnisse_en','showTags'=>'0'));
} ?>
I'm calling the tag cloud in a language-specific component with :
Code:
<?php get_i18n_tags(array('lang'=>'en', 'showlang'=>'0', 'slug'=>'suchergebnisse_en')); ?>
The links in the tag cloud are rendered correctly - pointing to, for example:
- http://.../getsimple/suchergebnisse_en/?tags=translation
My search result pages are language-specific (i.e. suchergebnisse & suchergebnisse_en) and I'm calling the results with:
Code:
(% searchresults numWords=15 showLanguage=0 HEADER='' component=searchresultrenderer lang=en %)
The searchresultrenderer component has:
Code:
<h3 class="search-entry-title">
<?php if ($showLanguage) { ?>
<span class="search-entry-language">
<?php echo htmlspecialchars($item->language, ENT_NOQUOTES); ?>
</span>
<?php } ?>
<a href="<?php echo $item->link; ?>">
<?php echo htmlspecialchars($item->title, ENT_NOQUOTES); ?>
</a>
</h3>
<?php if ($showDate) { ?>
<div class="search-entry-date">
<?php echo strftime($dateFormat, $item->pubDate); ?>
</div>
<?php } ?>
<div class="search-entry-excerpt">
<?php echo $item->getExcerpt($item->content, $numWords); ?>
</div>
There are no errors in the errorlog.txt file.
I am however getting a warning:
Code:
Warning: count(): Parameter must be an array or an object that implements Countable in S:\xampp\htdocs\_aa-de\getsimple_test\plugins\i18n_navigation\frontend.class.php on line 219
Could someone give me a hint about what I'm doing wrong?
You can see this on www.alan-amos.de
Many thanks in advance
Alan
Web Developer and Translator (German > English)