Hello,
I have searched for this online but couldn't get it working.
I have a view that I use for showing different items on my website. It is a very simple view that accept taxonomy term as argument and shows the related nodes.
This view also have a pager, that handle 20 items per page.
I want to see if it is possible to dynamically change that to another number, for example if we are in different category (taxonomy term), I want to show different items per page.
I have tried achieving this by hook_views_pre_build or hook_views_pre_execute but no chances yet!
Anyone can help please?
Comments
Comment #1
damiankloip commentedSorry, I'm not sure I understand what you are trying to do dynamically that contextual filters can't handle mormally?
Comment #2
damiankloip commentedoh, you want to change the amount of items per page dunamically!? Sorry, just got it :)
Comment #3
dawehnerHow did you tried to do that?
Something like that should probably work:
Comment #4
damiankloip commentedI think dawehner is right there, but you might need to use hook_views_pre_build instead to get it working?
Comment #5
damiankloip commentedI'm going to say this is fixed. The advice in the 2 comments above will work for setting the items per page.
Comment #6
WoozyDuck commentedThank you very much