Pager.cshtml Alternate

Topics: Writing themes
Jun 18, 2013 at 3:15 AM
Hi everyone,

I'm having a bit of an odd problem with an alternate I'm trying to create for the Pager shape. The alternate view starts out with the following:
    int totalPages = Model.TotalItemCount / Model.PageSize;

    if ((Model.TotalItemCount % Model.PageSize) > 0) { totalPages++; }

    // etc
What's particularly odd is this works fine for one projection of one content type, but for another it errors with the following exception:

Operator '/' cannot be applied to operands of type 'ClaySharp.Clay' and 'int'

When I look in the debugger, it looks like the Model object for the second projection doesn't have a TotalItemCount property.

How should I be getting the Total Item Count within this alternate? Why is the Model object passed in different between the two pages?