-if($languages_count > 1){
- $template->param(languages => \@options);
-}
-$template->param(CGIitemtype => $CGIitemtype,
- suggestion => C4::Context->preference("suggestion"),
- virtualshelves => C4::Context->preference("virtualshelves"),
- textmessaging => $borrower->{textmessaging},
- opaclargeimage => C4::Context->preference("opaclargeimage"),
- LibraryName => C4::Context->preference("LibraryName"),
- OpacNav => C4::Context->preference("OpacNav"),
- opaccredits => C4::Context->preference("opaccredits"),
- opacreadinghistory => C4::Context->preference("opacreadinghistory"),
- opacsmallimage => C4::Context->preference("opacsmallimage"),
- opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
- opaccolorstylesheet => C4::Context->preference("opaccolorstylesheet"),
- opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"),
+
+# display news
+# use cookie setting for language, bug default to syspref if it's not set
+my ($theme, $news_lang) = C4::Templates::themelanguage(C4::Context->config('opachtdocs'),'opac-main.tt','opac',$input);
+
+my $all_koha_news = &GetNewsToDisplay($news_lang);
+my $koha_news_count = scalar @$all_koha_news;
+
+$template->param(
+ koha_news => $all_koha_news,
+ koha_news_count => $koha_news_count