Hi,
I'm using this module for editing and displaying node forms and it works very well. I'm having trouble getting a view with a pager working in a popup.
For example, when displaying the node, a view is incorporated via a call to views_embed_view(), this works as expected when viewing the node on its own page. However, when viewing the same node in a popup, clicking on the view's pager controls results in the pop-up closing and the underlying page updating with the selection from the pager. I spent some time experimenting with the popups.js code so that pager buttons result in the popup div being refreshed but I couldn't get it to work.
Has anybody tried using views with pagers in a popup or is this something known not to work right now?
Thanks much (and thanks for a great module!),
Regards,
gene
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | popups_chaining.patch | 1.8 KB | kscheirer |
| #6 | popups-views.diff | 2.93 KB | gsally |
| #4 | popup-ajax-pager.diff | 2.08 KB | gsally |
Comments
Comment #1
sirkitree commentedI've not actually tried this, but couldn't resist changing the title slightly ;)
Comment #2
starbow commentedwhat you need to do if find out where the pager is being themes and add a class=popups.
Comment #3
starbow commentedAdd the class to the links, btw.
Comment #4
gsally commentedI spent some time fiddling with this. As a total hack I added this to the code that generates the pager links (theme_pager_link) in includes/pager.inc
Next, I bumped into this bit of code in the popus.js
Continuing my march of irresponsible programming, I commented this out. That lead me next to this bit of code in Drupal.popus.open
That was changed to the following:
And, mirabile dictu, the paging works. The view updates in the context of the current page. The view in question uses an ajax pager, I haven't tested with a non-ajax pager. One problem here: I can't seem to get the "close" link to work now. Not sure what I did.
The problem, which I haven't sorted out, is how to control the style of the pager elements on the view. This code works because of the hack that was made in theme_pager_link and that should be done correctly, as every pager link is set with popups, not just the ones that appear in popup-looking dialogs. I'm not sure of the right way to go about doing that, but I'll keep plugging along.
There's a patch attached with the changes so far. Sorry about this being half-baked, when I have something more done, I'll post that as well. I'm looking for "Danger Will Robinson!!" feedback with respect to the approach; if there's any, please let me know.
Comment #5
starbow commentedThat is more work than I thought it would be for you.
Display popup -> display popup is a resonable feature request. Let me know how far you get.
Comment #6
gsally commentedThese are the changes that I made and it works for Ajax based pagers for views. In order to get this to work, the view's pager anchor tags must have a certain class (popups-view-pagers). This diff was made against 1.9.2.18 popup.js.
Comment #7
starbow commentedDefinitely some good ideas here. I agree with you that it is worth being more flexible with allowing popup chaining. I am afraid your approach is a little to specific to your exact use case. Here is what I am thinking about.
Instead of prohibiting chaining, it changes to issuing a warning, but only if the chaining is happening inside a form.
Then, in Drupal.popups.open
This way the popup can resize and recenter itself for different content.
Then we just change the z-order in popups.css to loading=8, popups=9, and overlay=10, and bob's your uncle.
This doesn't get you your effect of having the paging popup links only pop if they are already in a popup, but act as normal links other times. I will have to chew that one over. Maybe if the class name were "popups-chain". I will sleep on it.
Comment #8
kscheirerI'm thinking the popup chaining would be really useful for the user login links. In fact, based on the number of posts and half-worked out modules that try to do this, I think this could be a big win for the popups module!
Let's say the user...
Using the attached patch to allow chaining (basically starbow's code in #7), and by adding the class
popups-formto the user/password link I can get 1, 2, and 3 to work. Not sure how to get 4 to work, any ideas?The only changes I made to #7 were: no confirmation for chaining, and some fadeIn/fadeOut effects for replacing the popup content.
Comment #9
kscheirerComment #10
starbow commented@kscheirer, I am a little confused. Think this issue predates popup chaining (or stacking as I am calling it now) being introduced into 2.x. Are you having trouble getting stacking working with latest alpha?
Comment #11
starbow commentedComment #12
kscheirersorry, I was using 6.x-1.3, will go check out alpha5 now!
edit: Stacking works great in alpha5. I did notice its a little different than chaining though. Previously the second popups would take over the body of the first, replacing it. With Stacks, the initial popup gets hidden under the new one, but once the second one is closed, the initial popup remains.
Is there a config option to destroy the first popup when link is clicked that opens the second? I'm looking at doneTest, but I'm not sure how to use it yet :)
btw, awesome work, I will be using popups on a lot of my sites in the future!
Comment #13
starbow commentedHmm, I don't think there is an option to destroy the stack. The doneTest option just helps you control when you open a new popup vs falling back to the previous one. I suggest you open a new issue with a feature request.
Comment #14
resynthesize commentedWhere is the status of gsally's original request? This is a problem that I also have. It looks like popups.js has changed significantly since the diff was posted and I could not apply it. I've tried running the latest dev copy to no avail. Any help would be much appreciated in getting this working.
Comment #16
jaime.davila commentedHi Guys, sorry for reopening this bug, I'm new with drupal, but I need to support chaining
I have a button which opens the popup with an url pointing to a view, but this view has pager, so it's possible to have some extra pages.
Is there a way to accomplish this?
Any help will be appreciated
Comment #17
jaime.davila commentedHi I just want to tell you I've been testing the patches and some modifications, and thx, it was unnecessary to reopen this bug.
Thx again :)