The pager should be added to $node->content as its own element during nodeapi('view'). Just use a high weight and it will float to the bottom. If you want to go the full mile, implement hook_content_extra_fields() from CCK so that the pager can be moved up and down using its UI. An example of this is in og.module - see og_content_extra_fields()

CommentFileSizeAuthor
#3 pagination-content.patch2.15 KBagentrickard

Comments

mundanity’s picture

Hi there,

Thanks for the feedback. I thought about doing something similar, the issue was I didn't want this module to require anything else (even though I do realize CCK is fairly widely used). I'll look into an option for making it CCK aware in that sense.

psicomante’s picture

Interesting, thanks moshe weitzman for the tip, i patch the module until the feature will be included

+1.

agentrickard’s picture

Status: Active » Needs review
StatusFileSize
new2.15 KB

Attached is a quick patch (vs. svn diff) that moves the pager to $node->content['pagination'] with #weight of 50.

_Please_ run this entire module through Coder and follow proper coding conventions. Reading the code is painful.

mundanity’s picture

Status: Needs review » Fixed

I've implemented partial support for hook_node_extra_fields() in dev. If I can think of a decent way to display the pager/toc in form_alter() this functionality will be in the next 1.4 release. Thanks for your help!

agentrickard’s picture

You need to use the cck weight function to determine the #weight of your form element.

$fom['myfield'] = array(
    // This lets CCK adjust the weight of our element.
    '#weight' = module_exists('content') ? content_extra_field_weight($form['type']['#value'], 'myfield') : 1,
);
mundanity’s picture

Hi there,

The reason the code is not in form_alter() is due to appearance really, since the ToC and pager are not form elements, and just having a line saying "This is the pager" didn't really sit that well with me. I may just shove it in there after all to allow CCK to do it's UI fun stuff, but I'd like a bit more time to think on a better visual implementation if possible.

agentrickard’s picture

Right, I'm just saying that it is not clear from the CCK docs that adding hook_node_extra_fields() is not sufficient. You also have to implement it at the form level, otherwise the CCK UI sort does nothing.

mundanity’s picture

Hey there,

Yes you're right, I re-read what I put earlier and can see where it would be confusing. What I should have said is, the feature is not active yet, as it's waiting on a decision about the display while editing a node. Once I sort that out I'll finish that up and "enable" support for extra fields.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.