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
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- internetking created topic »password problem« 25. May
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
News paging
-
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
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. -
**unknown user**
- Rank: Freshman
- Registered: Mar 16, 2002
- Last visit: Jul 22, 2008
- Posts: 53
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! -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
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. -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
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. -
**unknown user**
- Rank: Freshman
- Registered: Mar 16, 2002
- Last visit: Jul 22, 2008
- Posts: 53
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 -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
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. -
**unknown user**
- Rank: Freshman
- Registered: Mar 16, 2002
- Last visit: Jul 22, 2008
- Posts: 53
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? -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
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. -
**unknown user**
- Rank: Freshman
- Registered: Mar 16, 2002
- Last visit: Jul 22, 2008
- Posts: 53
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
- Moderated by:
- Support
