Ok let me explain a little further
if i use
[view:myview]
I get the pager supplied by Views
If i use
[view:myview=50]
i get no pager just the view limited to 50 nodes
If i use
[view:myview=50=arg1]
i get my views limited to 50 nodes where argument 1 applies
If i substutute =50= for == or =0= i get all the nodes that apply to argument 1
What i want to do is have the views pager though when using arguments
so something like
<code>[view:myview=((usepager)or(maxnode))=arg1]
a possible sollution might be if the number of pages were the last term so it was
[view:myview=arg1=pages]
leaving off the last term i am guessing would allow for the Views pager
So my question is how do i get to use the pager with arguments, has it been done and if so how
TIA
Comments
Comment #1
mlsamuelson commentedI've marked a few other pagers issues as duplicates and pointed them here, as I feel midkemia's examples give the best jumping off point for clarifying the issue.
Basically, what we need is to add a layer of logic so we can tailor our views_build_view() (see http://drupal.org/node/121202) to whether we're doing a simple limit or wanting to use the pager.
Additionally, we need to make sure there aren't any unforseen consequences of bringing pagers into nodes.
I've changed this issue to a feature request.
Duplicate issue references: http://drupal.org/node/162873 and http://drupal.org/node/121202
mlsamuelson
Comment #2
mlsamuelson commentedAnother duplicate for reference: http://drupal.org/node/67258.
Comment #3
square_rinoa84 commentedI've the same issue. Anybody knows how to fix this???
Comment #4
yngens commentedSame problem here. My inserted view lists only limited number and it is not possible to view extra pages. I do not understand much about how to use arguments, but trying this code:
<? [view:comments_all=3=use_pager=true] ?>
did not work. So as I understand Insert View module does not support use of pager at all for now? Or I am doing something wrong?
Comment #5
yngens commentedok, after reading all the related threads i found a solution posted by Borek: http://drupal.org/node/121202. bkz mlsamuelson is trying to concentrate on this page, i would like to confirm here, that it worked for me. but i am confused with mlsamuelson's comment there:
Thanks, Borek! It's actually a little more complicated than this because of conflicts between the Insert View limits and how we're passing that info to views_build_views.
what is with and how much wrong the suggested by Borek method?
Comment #6
jpoesen commentedI confirm that the Borek fix (http://drupal.org/node/121202) works and have not yet experienced any side effects...
Comment #7
osopolarI use Borek's fix too but only if there is no limit in the insert view tag.
(line 75)
Comment #8
mlsamuelson commentedI've attached a patch that allows a person to insert a pager view by setting a limit and replacing "view" in the tag with "view_pager".
So for example, to insert the tracker view so it'll only display 5 results per page, you could do [view_pager:tracker=5]
Please, test this and let me know if:
1. the patch works
2. the functionality works in your scenarios
mlsamuelson
Comment #9
john bickar commentedPatch fails for me against the 03/11/08 5.x-1.x-dev version.
Comment #10
mlsamuelson commentedI've re-rolled the patch.
Comment #11
john bickar commentedFor me:
Thanks!
Comment #12
mlsamuelson commentedIn light of #11, marking this as RTBTC...
I plan to commit the patch this evening, time permitting.
Thanks cubbtech!
mlsamuelson
Comment #13
mlsamuelson commentedThanks, cubbtech!
Committed.
(And now I've also created the initial 5-x-1.0 release.)
mlsamuelson
Comment #14
Anonymous (not verified) commentedBefore I upload the latest release I would just like to clarify the syntax?
views_pager:myview=pages=arg1,arg2,arg3
Comment #15
mlsamuelson commentedClose. No 's' on view. It should be:
(That would insert the view "myview" with a pager showing 3 results/nodes at a time, supplying the args 4, 5, and 6.)
And note, this is, of course, only for views you want to have a pager on. You can continue to use the classic non-pager style of Insert View tags.
More info is in the README.txt. Additionally it wouldn't hurt to read the upgrade info in there.
And lastly, if you install the new version and the filter cache is causing your views to be cached, simply go to the input filters admin page, click configure for the formats in question, make sure the Insert View filter is turned on, and then submit the form (even if you made no updates, as this will jog the input format's memory and it will clear the filter cache and no longer cache the views).
mlsamuelson
Comment #16
Anonymous (not verified) commentedYou spotted my normal mistake with InsertView for almost a year now I have first typed 'views' before going back and changing it to 'view' , maybe it seems natural to me
The reason i queried the use of the args is its not given as an example in the readme file, all that exists is
Maybe the addition of the following may help
Comment #17
mlsamuelson commentedIn light of comment 16, I'm going to mark this as active and a task... I would like to make the README.txt as thorough as possible.
Thanks for the feedback, midkemia.
mlsamuelson
(Note to self: see #180042: insert view filter results should not be cached., for additional README.txt updates.)
Comment #18
Anonymous (not verified) commentedFirst Installed 5.x-1.0 and the views_pager funtions perfectly.
Note: It took 2 installation attempts to get the filter to show up.
The following is an observation but as we have no category for that I taged it on here
There also seems to be a good side effect/issue from the updated module, though it is probably down to the changes you made to how it works.
Let me explain
I had been using the Alinks module, but it would not create links to cck fields that were contained in nodes, nor views, nor views inserted using Insert View.
Now after upgrading to 5.x-1.0 of Insert View, the Alinks module will link for nodes that form part of a view and inserted using insert views (but still doesn't to nodes or views)
I have mentioned this in case it is the sign it may not be functioning as expected.
Comment #19
mlsamuelson commentedInteresting.
Haven't played around with the Alinks module, but what pops to mind is that this might be an effect from Insert View turning the filter format into a non-cacheable format - which it does now.
mlsamuelson
Comment #21
pasqualleclosing all D5 issues
pager works in D6 and D7 releases..