Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Customize CMS paging from > to next or so... View modes: 
User avatar
Member
Member
J4F - 5/31/2011 5:27:07 AM
   
Customize CMS paging from > to next or so...
Hi

I would like to change the next and previous symbols of SQL Search result pager from < > to words like "next or previous" in separated languages.

I use culture but in this case the search result dialog with pagin elements are shown in english.

Where can I change that.

Thanks for help

J4F

User avatar
Member
Member
kentico_michal - 5/31/2011 5:48:23 AM
   
RE:Customize CMS paging from > to next or so...
Hello,

You can change this behaviour in the following file ~\CMSWebParts\Search\cmssearchresults.ascx.cs by setting PagerControl.NextText and PageControl.BackText property in the SetupControl method:

srchResults.PagerControl.NextText = "Next";
srchResults.PagerControl.BackText = "Previous";



Best regards,
Michal Legen

User avatar
Member
Member
J4F - 6/1/2011 4:52:27 AM
   
RE:Customize CMS paging from > to next or so...
Hello,

Thank you for help. It works now.

I took your solution and modified it a little. I've created some setter and getter like:

public string NextSymbol
{
get
{
return DataHelper.GetNotEmpty(this.GetValue("NextSymbol"), this.srchResults.PagerControl.NextText);
}
set
{
this.SetValue("NextSymbol", value);
this.srchResults.PagerControl.NextText = value;
}
}

And now I can set the paging text in the webpart itself. Also for different cultures, like this:

{$=nächste|fr-CH=suivant|it-CH=prossima$}

That works perfect :)

Now in this case I would like to change also the text "Displaying results 1-10 (of 22)" in other languages.

Where can I modified this part of code. I could not find the source.

J4F

User avatar
Member
Member
kentico_michal - 6/1/2011 5:51:38 AM
   
RE:Customize CMS paging from > to next or so...
Hello,

You can use the same approach as in the back/next issue. This time, you will need to use ResultsFormat property of the PagerControl:

srchResults.PagerControl.ResultsFormat = "custom string";

However, it should be possible to achieve by modifying resource strings. ResultsFormat property is by default set to resource key called datapager.resulttext:

<data name="datapager.resulttext" xml:space="preserve">
<value>Displaying results {0}-{1} (of {2})</value>
</data>

You can find this definition in the ~/CMSResources/CMS.Resx file.
The values of parameters {0}, {1} and {2} are then dynamically replaced.

So if you want, you can localize this resource string to any culture you want.

If you need more information about localization please visit the following section of Developer's guide:
Configuring multilingual and RTL UI


Best regards,
Michal Legen