I'd like to add the option to paginate the FAQ pages using the standard Drupal pager. The reason is I have a client who wants to add a lot of faq's (hundreds per category).
Ideally the pager would be configurable so we could choose how many faq's to have on each page just like the Post settings in Drupal.
Currently we are using these options:
- Clicking on question opens/hides answer under question
- Display short text
- Use answer teaser
- Show node links
I mention this in case you think it will matter what options are chosen wrt adding a pager.
I know I can probably forge this using Views and theming but ideally I would like to have this in the module.
Any thoughts or suggestions?
BTW - great module and kudos to you for the tpl files and theme functions which make it very easy to theme this module, really excellent.
Comments
Comment #1
stella commentedI thought about implementing this feature but I've come to the conclusion that it isn't something that the majority of users will use or need. That, combined with the fact that you can achieve the same result using the Views module, means I won't be adding this feature to the FAQ module.
I will reconsider it if there's more interest from other users in the future.
Cheers,
Stella
Comment #2
Coxus commentedYes, i need this functional too
Comment #3
diegohermes commentedI think this feature would be very useful, i don't understand when you say that it can be achieved using views, with views - as far as i know - you can't use de collapse/expand effect in the questions that this module have. If there is a way of use the effect in views, can you please explain?
I created my own faq with CCK + views + custom js file, but i like your module, the only thing that is left, in my opinion, is the pager.
Regards,
Diego
Comment #4
diegohermes commentedComment #5
Jeff Burnz commentedComment #6
stella commentedUnfortunately I still don't plan on adding this feature. You can achieve pagination using views, and most of the faq module's features. You can't achieve the javascript functionality, but I'm sure you could (or find someone to) write a small bit of jQuery to achieve the same effect.
Cheers,
Stella
Comment #7
Jeff Burnz commentedI think the last relevant comment asked "how to do this with views" hence the documentation status, is that a problem? I would write this when I have time, do you not want that contribution here?
Comment #8
redkostia commentedTo implement pagination is needed to change a little bit faq.module code.
instead of
$result = db_query(db_rewrite_sql("SELECT n.nid, if((w.weight IS NULL), %d, w.weight) as weight, n.sticky, n.created FROM {node} n INNER JOIN {term_node} tn ON (n.nid = tn.nid AND n.vid = tn.vid) LEFT JOIN {faq_weights} w ON w.tid = tn.tid AND n.nid = w.nid WHERE n.type='faq' AND n.status = 1 AND tn.tid = '%d' ORDER BY weight, n.sticky DESC, n.created DESC", "n", "nid"), $default_weight, $term->tid);we should use
pager_queryfor example
Then in .tpl files
you should add
<?php echo theme_pager(array(), 2, 2);?>