By Anonymous (not verified) on
Hello guys, im using views_embed_view() to embed a view on a node,
by default I set the view's items_per_page to 10, how do I limit the result being displayed on the view to 2 when it is being embed?
Hello guys, im using views_embed_view() to embed a view on a node,
by default I set the view's items_per_page to 10, how do I limit the result being displayed on the view to 2 when it is being embed?
Comments
...
The following code isn't tested, but it should work.
Im going to test it now,
Im going to test it now, hope this works on views 2. thanks man!
UPDATE:
Thanks man, it did work. is there also a way to check all the total rows returned?
...
do
print $view->total_rows. However, this number is calculated by default only if you're using a pager (because it isn't needed otherwise); to force calculating it, do$view->get_total_rows = TRUEearly on.wow cool! thanks a lot man.
wow cool! thanks a lot man. =)
Print something after the last item
Hi mooffie,
Thank you for your code.
I would like to print something after a text meesage after the pager in the first page of the view only. Here are the problems I faced.
1. When I used just the footer in view, it printed the message before the pager . Actually I want it after pager.
2. When I put the message in the last line of views-list-x.tpl.php page, the message is printed 10 times along with each item.
3. I tried to create a condition using the code you provided (for different purpose) to check whether it is the first page and whether it is the last item in the first page and then print my message. But I messed up everything. (I am not a programmer.)
How do I do this?
First Page of view
Display list of 10 items
Display Pager
My Message
Thanks a lot.
sometimes...
...you just find finally what you need ! Thanks to you. Happy new year !!!
David THOMAS
http://www.smol.org