Great work! I'm not sure if this is possible, or could be a feature idea:
The ability to define a page title/index in the drop down from within the body - something like:
<!--pagebreak--Introduction-->
<!--pagebreak--Specifications-->
<!--pagebreak--Conclusion-->Resulting in the page drop downs as:
| Page 1 - Introduction |
| Page 2 - Specifications |
| Page 3 - Conclusion |
As used on many review type sites etc.
Thanks a lot!
Tim
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | smart_paging-1146218-9.patch | 2.91 KB | sk33lz |
| #4 | smart_paging.zip | 29.99 KB | maxiorel |
Comments
Comment #1
arpeggio commentedThat would be a nice feature. We will include that on Smart Paging's next major version feature list. Thank you for the suggestion.
Comment #2
Tim Jones Toronto commentedThank you, if you need any help etc let me know.
Comment #3
arpeggio commentedYes. Patches are welcome, if you're available to implement this feature that would be great. Thanks.
Comment #4
maxiorelHello, I did some changes against the 7.x-1.3. However I'm not able to create a good patch now. If you find it useful, I will be glad, if you can commit.
How it works:
1. in *.module are new lines 731 - 740 which scans the fragmented pages for a first H2 occurrence. This will be used for page title/name.
2. New line at 816 which puts the chapters names to the JavaScript for the pager.
3. New lines at smart_paging-pager.js at 6 and 7 - get the chapters names.
4. Changed the line 36 in smart_paging-pager.js to create pager with chapters names instead of the "Page Nr."
Hope it will help you.
Comment #5
arpeggio commentedHi, sorry for the delay. Thank you for contributing code. I have test your version of smart paging (your attachment source code) it returns error:
Notice: Undefined offset: 0 in smart_paging_field_attach_view_alter() (line 734 of C:\xampp\htdocs\sites\all\modules\smart_paging\smart_paging.module).... and it does not page does not break. The body content is:
Comment #6
dean clayton commentedHas this feature been added in the latest version?
Comment #7
arpeggio commentedNot yet, it still has bug.
Comment #8
dean clayton commentedok not a problem, thanks for the update
Comment #9
sk33lz commentedI've rolled a patch against the latest 7.x-2.x-dev that works as OP intended.
Comment #10
arpeggio commented@sk33lz I have reviewed your patch. Your version of this feature is based on
<h2>. What if my pagebreak looks like this:There are 3
<h2>, so the dropdown will be:Where I should expect:
... and not all the users want their titles to dropdown menu be based on
<h2>.The original suggestion seems the safe approach for this feature:
Resulting in the page drop downs as:
Comment #11
sk33lz commentedYou are right, as it's not ideal in some cases, but works for how I have been using it. I'll work on a better solution and will submit a new patch when I have it ready for review. Thanks for taking a look at the patch.