Fork me on GitHub

News paging  Bottom

  • Hi,
    Just testing .8 and wondering how I limit news articles on the homepage?

    I only want a couple, but using the setting in the News administration limits the news pages too. I want say 10 per page in the news module, but only 3 on the homepage.

    Is there a parameter I should use in the Admin Settings?

    Thanks
  • There are, at least in the current SVN code, two paging options; The first 'Items per page' applies to the admin panel, the second 'Number of Stories per page' applies to the user interface.

    These two could be clearer as to which one does which and, if I recall, there was some confusion in the code over which one does which. In the current code both settings work as expected.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Hi Mark.
    Sorry, I don't think I was clear enough. Yes those settings do that. But I used to be able to explicitly set how many articles appeared on the homepage. How do I do that now? I assume it is via Admin > Settings >Start page > Arguments for start function ?

    Thank you!
  • Let me see if I follow you.... Your asking about being able to have a different number of articles on the first page to every other page? If so then that can't be done in the current code as the number of items per page is explicitly set to the value in the admin panel.

    Given that the .7x news module wasn't API compliant I don't believe that the start arguments setting had any affect. So how did you achieve this in .7x?

    Saying all of that this should be a trivial change to make!.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Adam,

    Just looked at this further... While it's easy to implement the reading of the input the effect that this has on the default pager is far from ideal.

    As an example I setup 6 news articles, set the default pager to 4 per page. Thus by default I get two pages; 4 articles on the first and 2 on the second.

    Updating the settings module to supply an itemsperpage value of 2 produces a pager for the first page that reads 'Page 1 / 3 (1 - 2 of 6 Total)'. This is correct since when paging at 2 items per page there'll be 3 pages of 2 articles each. But when I click the next page button I get a pager that reads 'Page 2 / 2 (5 - 6 of 6 Total)' again correct but inconsistent with the first page.

    I'll commit this change to SVN but, for this to look right, you'll need to alter the display of the pager for the news module to overcome this. Using one of the additional pager templates overcomes this problem.

    e.g. override the news_user_view template and add the parameter template=. pagercss2 would be a reasonable template (or even create your own!).

    Note: There's bug in the pager plugin that i'm fixing at the same time thats needed for this to work properly too.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Hi Mark,
    Thank you very much for that.

    I had already considered the pager. I hadn't decided whether or not to override the template, or simply to add some CSS ( display: none; ) to my homepage so that the pager isn't shown...

    Once again, thanks!

    -Adam
  • Adam,

    Looking at the end results on my test setup there's still a problem with the pager... When you reduce the amount of articles on the first page by two you then miss those two out in the paging.

    This is because, on the user side, we use page numbers instead of offsets to do the paging. i.e. News/view/page/2, 3, 4 rather than News/view/page/4, 8, 12.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Hmm, OK, I think I'm just going to add some CSS to it and hide it - we don't have a pager on .76 anyway, so it's no loss.

    By the way, what is the "proper" method for changing the pager default template? I guess I should I just use the theme to override pagerimage.html with one of the other templates? Or is there some setting I should use?
  • adamjjackson

    Hmm, OK, I think I'm just going to add some CSS to it and hide it - we don't have a pager on .76 anyway, so it's no loss.

    Yes we do! See administration - >settings -> enable news pager

    adamjjackson


    By the way, what is the "proper" method for changing the pager default template? I guess I should I just use the theme to override pagerimage.html with one of the other templates? Or is there some setting I should use?


    The default template for the pager is pagerimage.html in the pnRender module. So to override this template globally copy pagerimage.html to config/templates/pnRender and then alter this template as desired.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • markwest

    Yes we do! See administration - >settings -> enable news pager

    Oops. Oh well, what I mean is that it's always been fine for me without one!

    OK, will do that then. Thanks again for your help

This list is based on users active over the last 60 minutes.