Hi there and thanks for the module. If I get it working it will help me out of a big hole.
I have tried deploying the module on a Node Reference Field but nothing is showing up - the nodes continue to list out in full as per normal. Should the pager appear for node references?
Some details:
- I am using the "Title (link)" (default) formatter for the node reference field
- CCK Pager has been activated as a module and customised for the nodetype in question
- I am using D6.14 and cck 2.5
- after debug printing out the formatter keys I see that "keycck_pager_default" is in the loop of cck_pager_theme function
- cck_pager_formatter function is never called on the page
I'm not sure if this is a bug or if I am doing something wrong in config.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 623848_nodereferrer.patch | 1.5 KB | murrayw |
| #1 | cck_pager-623848-1.patch | 1.62 KB | peximo |
Comments
Comment #1
peximo commentedHello, thanks for your help, this is a bug in general, not tied specifically to nodereference.
I have committed the solution on the dev (but it takes time to make it available for download on project page) and attached to this issue the patch. Once installed the dev or applied the patch you must clear the cache. Thanks again!
Comment #2
murrayw commentedWow. Thanks for responding so quickly. I tip my hat to you :)
The patch did mostly work. The new CCK Pagers come up in "Display fields" now and choosing the pager did work in that paging was operational. Nice one.
However, there was a small glitch in the HTML used to render them. The divs wrapping the items have been removed. I see from another issue that this is just the way they are rendered. I can work around this by making the anchors blocks however, there are no obvious css selectors (eg. class='cck_pager') to use to do this apart from going through all my own fields which need to be paged.
Cheers.
Before CCK Pager
After CCK Pager
Comment #3
peximo commentedHi, the module re-implements the previous defined cck formatters with an handling of multiple values managed by the module instead of the core (CONTENT_HANDLE_MODULE).
This approach implies that all the values are inserted into the first item.
But I have find a solution, a little trick to avoid this problem; I have committed this change to the dev, but I don't have now time for a full and exhaustive test.
Obviously, some testing was done and I don't have find any problems.
So if you want to use this new version download the dev (when available); after a complete test I will commit a new major version.
Thanks you again for reporting the problem, I hope that the new version is suitable for your work.
Comment #4
murrayw commentedThanks. The new dev update is now printing out some nice HTML with the divs and the odds and evens.
I have found some more issues and I'll keep going in this thread because the title still relevant because there are problems with using nodereferrer fields. The issues are not with cck_pager, per se, rather some quirks with nodereferrer. The UI for cck_pager works OK in that it is possible to define a CCK Pager formatter for a noderefferer field. The problem is that none of the referred node print out.
Firstly, nodereferrer has an unexpected answer to whether or not it is empty with nodereferrer_content_is_empty always returning true:
This means that the cck_pager_formatter function always returns early, resulting in no nodes being displayed at all. We work around this with a special case:
The structure of elements[0]['#item'] actually contains all the content for all the referred nodes.
This differs from the result for a nodereference which just has the node id
The end result is that (i) the item count is wrong and (ii) even if the count is fixed, nothing will print when the items are passed through to the formatter. I worked around this in a hackish way by making the items appear as though they are nodereferences. This involved restructuring the array and changing the type of the fields from nodereferrer to nodereference. All very ugly and would be interested if anyone had a better suggestion.
Working for me now and patch included. Use at your own peril :) Maybe this will be helpful for someone in the future.
Comment #5
peximo commentedIn these days I worked on a new version, born from your bug report and an issue addressed to the CCK authors: this version resolve more elegantly and correctly your previous problem. If you can try the new 6.x-2.0-beta1 version.
Comment #6
murrayw commentedThanks. Works nicely. Looks clean.
Comment #7
peximo commentedComment #8
murrayw commentedI'll have to reopen this one - sorry. Unfortunately nodereferrers are not paging again.
In cck_pager_preprocess_content_field(&$variables), $childrens is coming back with with a count of one even though there are lots of node referrers:
Array
(
[0] => 0
)
The result is that there is no limitation on the referrer nodes and no pager widget displayed.
I'm using the latest 6.x-2.x-dev of cck_pager, released 2009-12-10. I believe that nodereferrers may not have been working the previous dev release as well. I'm using the latest stable cck: 6.x-2.6.
It is possible to page referrers using code from that module but ideally this could be done using the same mechanism as cck_pager for consistency.
Comment #9
peximo commentedSorry, I committed a wrong version, now the dev should be the correct one and the bug should be fixed.
Comment #10
peximo commented