Simple change in Pager.cshtml

Topics: Administration, Customizing Orchard, Localization
Jun 7, 2013 at 9:26 AM
Edited Jun 7, 2013 at 9:33 AM
Hello everyone!

I must change pager text on blog posts. On my site there are two blogs. I would have two different pager texts, for example: Newer Blog1, Newer Blog2, Older Blog1, Older Blog2.

I can change pager text, but two blogs will have the same pager text.

Can I place here something like:
if (Model.ActualUrl.Contains("xyz")) Model.PreviousText="xyz" else Model.PreviousText = "abc".

But how to get actual Url ? Maybe there are best solutions for do something like this.

This is pager.cshtml file, where I made changes.
@{
    Model.Quantity = 0;
    Model.PreviousText = "Newer Blog1";
    Model.NextText = "Older Blog1";
    Model.Classes.Add("group");
    Model.Metadata.Alternates.Clear();
    Model.Metadata.Type = "Pager_Links";
}
@Display(Model)
Developer
Jun 7, 2013 at 12:51 PM
have you tried to use url alternates?
Jun 7, 2013 at 1:15 PM
Edited Jun 7, 2013 at 1:16 PM
Can you tell me something about it? These line is my first modification in orchard, and i doesn't know too much about it :(
Model.PreviousText = "Newer Blog1";
Developer
Jun 7, 2013 at 7:16 PM
Nick is suggesting that you create two pager templates: one for url xyz, and another for abc, e.g.:

Views\Pager-url-xyz.cshtml
Views\Pager-url-abc.cshtml

The documentation explains how alternates work.
Jun 10, 2013 at 7:18 AM
Thanks a lot, I'll try to do this :)
Developer
Jun 10, 2013 at 11:22 AM