INCORRECTLY classes second last TOC item as class="toc-item last"

austintnacious - October 22, 2008 - 09:12
Project:Pagination (Node)
Version:6.x-1.2
Component:Code
Category:feature request
Priority:minor
Assigned:mundanity
Status:closed
Description

As the title of this post suggests the module is incorrectly giving "last" to the second last itme in TOC lists.

Any plans to allow nesting of [ header ]s?

This is a cool little module but with nested [ header ]s and the DHTML menu functionality = SUPER SWEET!!!!

#1

mundanity - October 22, 2008 - 17:12

Hi there,

Thanks for the feedback, I'll add a fix for the last class issue in the next patch. For nested headers how would the default pager look? (no difference?). I'm assuming you mean something like:

Table of Contents:

  • Page 1
  • Page 2
    • Child of Page 2
    • another child
  • Page 3

#2

mundanity - October 22, 2008 - 20:10
Category:bug report» feature request
Assigned to:Anonymous» mundanity

Hi there,

The incorrect assignment of class values for the table of contents has been fixed in version 1.3, thanks for your help!

#3

austintnacious - October 22, 2008 - 20:53

Yes the TOC would look as you suggest above.

hey, I see you have another thread in here about CCK fields. . .

I had to turn off Pagination because it was conflicting with any pages where I had view reference fields using views paging.

Is this fixed in 1.3?

Can I turn pagination node back on?

#4

mundanity - October 22, 2008 - 21:00

Hi there,

I *believe* it should work with cck/views now. I don't have a lot of experience with either from an end-user point of view, but assuming views just moves fields around the body, I believe it should work now (paginating the main body only, with visible CCK fields on each page as expected). If you find this is not the case please let me know.

#5

zoia - October 25, 2008 - 21:38

I have installed the module but something goes wrong . Although splits the content , the links next or 1,2 show the same First page. I dont know what to do with this. Pls somebody help

#6

mundanity - October 27, 2008 - 19:09

Hi Zoia,

Can you provide a URL to your install? Also it may help if you can provide more information (are you using manual or automatic paging, what sort of node type are you trying to page? what sort of additional modules do you have installed that may be interfering with pagination?)

#7

zoia - October 27, 2008 - 20:29

mundowen I can provide the link for testing but i have deleted the contents with pagination and made a book with pages instead. It seems that this bug is related to my custom template or my server permitions as neither in fck editor the button drupal pagebreak worked. If you want to take a look by your self i will create a testing post and i ll provide the exactly url
Regarding you questions i use manual paging the node was a story - no additional modules just fck editor ( module paging was tested and unistalled before installing pagination although it worked out the solution of page break , replaced the the fck editor interface when editing with its simple code table)

#8

mundanity - October 27, 2008 - 20:48

Hi Zoia,

I'd appreciate that, I'd like to make the module play nice with other ones as well and that could definitely help.

#9

zoia - October 27, 2008 - 21:47

i cant believe it !!!the testing page works smoothly now - the differnce from the deleted one is : I had an image aligned in left were the table of contents apear (when chosing the correspondent view) because the table moved out of the block my image i changed view to default . Another fact pehaps is related to greek titles [header= τραγούδια] which now is [header=page1]
http://1dim-giann.pel.sch.gr/?q=el/content/testing-pagination-node
Now that there is no image in the draft post everything appears ok

#10

mundanity - October 28, 2008 - 00:32

Hi Zoia,

Ah good, thanks for the feedback. The table of contents is tacked onto the main content and as such I could see a scenario where there is conflict with other elements (such as images) which are also tacked onto the content, and styled in such a way to "compete" with the ToC. I'll try to think of alternatives to get around that in future revisions.

#11

austintnacious - October 28, 2008 - 02:46

and styled in such a way to "compete" with the ToC. I'll try to think of alternatives to get around that in future revisions.

I think your use of id="toc" to uniquely identify the TOC's containing div is pretty solid. I'd suggest using id="pagination-toc" or something similar tho', first to help guarantee uniqueness but mostly to identify to users like myself which one of the potentially 100s of modules we're using is spitting out the code we're working with. Or you could offer the user the option to define their own CSS id/class(es), like in Panels.

As a further suggestion, I think it would be cool if you could make the TOC created by Pagination (Node) optionally available as a block that can be placed via the Blocks admin page with the options available to system blocks, like "display only on these pages" or "display on all pages except", etc.

#12

zoia - October 28, 2008 - 10:11

Thank you for you support
Another issue is that interfares with the teaser break. In this case produces too similar pages ingoring the break by the teaser

#13

mundanity - October 28, 2008 - 18:51

@austintnacious:

I like the blocks idea, I'll take a look to see how feasible it is.

@zoia:

Hmm, are you talking about full page views (ie, clicking on the node) but having the teaser show up as well? (ie, teaser + body in full page view?). I'll take a look to see if that's an easy thing to deal with, but I have a feeling I'd have to code the module to be aware of nodes that present teasers in full page view.

#14

zoia - October 29, 2008 - 15:46

yeap you could check the above link(not deleted yet) in full node view. There is a teaser after first paragraph. Pagination ignores the teaser and saws the full page. but this wouldnt be a problem if used only one page from the start to the page break. I realized that the pages 1,2 presents exactly the same content.

#15

quex - November 16, 2008 - 02:24

Hello!

I just wrote a basic feature to show table of content as block. It is strongly based on _build_toc();
Just add it to end of pagination.module and setup a block in drupal site. Good it is also change Pagination style to Default paging (becouse Table of Content will be shows as block)

It works, and show this block only on this node with paging is enabled and is paging used.

<?php
/**
* Implementation of hook_block();
*/
function pagination_block($op = 'list', $delta = 0, $edit = array()) {
  if (
$op == 'list') {
   
$blocks[] = array('info' => t('Table of Content, module pagination.'));

    return
$blocks;
  }
  else if (
$op == 'view') {
    if(
$delta == 0) {
       
// disable block on start
       
$block = null;
       
       
// it's not front page
       
if(!drupal_is_front_page()) {       
       
           
// shows only on ?=node/$nid page
           
if(arg(0) == 'node' && is_numeric(arg(1))) {
               
$node = node_load(arg(1));
               
$type   =   $node->type;
               
$page   =   _get_page_var();
               
$pages  =   _get_pages();
               
$paging =   _get_pagination_value($type);

               
// paging is enabled for this node type, and dont show on all node, and number of pages is more then 1
               
if($paging && $page !== 'show' && $pages > 1) {
                   
$block = array('subject' => t('Table of Content'),
                     
'content' =>  theme('item_list', _header('all', _get_page_var() ), null, 'ul', array('class' => 'toc-list') ));
                }   
            }
        }
    }
    return
$block;
  }
}
?>

Sorry for my bad english :)
I'm just started it's my first time when i write something on drupal.org :)

#16

mundanity - November 18, 2008 - 08:03
Status:active» needs review

Hi Quex,

Great addition! I'll try get out a release this week with this addition to it.

#17

mundanity - February 17, 2009 - 06:51
Status:needs review» fixed

@austintnacious

Please be aware that the new dev version (soon to be 1.4) adds namespaces to the CSS classes in the ToC, ie id="toc" becomes id="pagination-toc" and so forth.

@quex

Thanks for your code, I've added block support to dev (aka soon to be 1.4)

#18

System Message - March 3, 2009 - 07:00
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.