I'd like to request that cck allow the option of having previous page, next page links, of the type found in book.module. Also, I'd like to request, it'd be a checkbox option. (like in category.module. I couldn't get category.module to work.)

In the meantime, I can try to do it myself by hacking the template files. I read the handbook pages but I don't know how to adapt them for cck. I posted what I tried at 54984 and 55328. If you can provide instructions that would be great.

Comments

jonbob’s picture

How do you envision this working? How would CCK know what the next page and previous page are? Node reference fields?

kae’s picture

Right now the previous/next links are sorted by the alphabet for
book
and sorted by date for
everything else.

I suppose it would be best to have both options, and let the user choose.
Thank you.

karens’s picture

This could get very complicated since there are lots of different ways you might want to chain your nodes together. You said you couldn't get category to work. I can't tell exactly what problems you ran into, but category worked great for me. Category is a complex application, so it took some experimenting to find out how to best use it. Here's how I made it work with CCK to get back/next links and a table of contents on the parent pages:

1) Be sure to install category menu and category transform.

2) If you want your cck nodes in their own grouping, create a container for them. When you create the container, indicate that you want back/next links on the categories inside it and that you want a TOC (table of contents) used and set the depth of the categories inside the container to be more than 0. You will probably want to add the container to the menu, too. If you want to use an existing container, make sure it has those options set.

3) Create your cck node.

4) Edit the cck node, and click on the category tab and indicate you want to add it to the category outline. While in the category tab, make sure you indicate that it should be in the container you just created. Once you have more than one node in there, you will also have the option to select a parent for the node.

5) You should now be able to go to the container and see a table of contents listing the node you just created. If you view the node, you will see back/next links (if there are other nodes in there) and an 'up' link.

6) For even more options, you can install category views which allows you to create a views table or listing of the nodes that shows up on the parent page instead of the default teaser list. You can put the node title and date into the view, plus whatever cck fields have been views-enabled (that part of cck is still under construction).

You have to play around with the category settings since there are lots of different options. You can choose multiple parents and even distant parents (categories in other containers) for the construction of the outline and back/next links (you have to set this all up in the container).

kae’s picture

Jon and Karen,
Karen, thanks for the long detailed post. I'll try it later on.
Jon, I still want to make this feature request because I think it's best if it's integrated into core, and Jeremy seems to think category will not be integrated into core. Once something is integrated into core, it's part of the upgrade path, it's maintained, and it's secure. Also I think this would be great functionality to have for beginners who don't know how to install modules.

kae’s picture

Also, catalog requires one to replace the taxonomy module with a 3rd party taxonomy module. I really don't think such important functionality as prev/next page in book should require this.

karens’s picture

Just wanted to point out a couple other ways to accomplish this (and I'm not downplaying your request or saying it might not be desirable to add at some point, just pointing out there are several ways to do this already):

1) Use the book module. It is in core, which seems to be your concern, and it is the way you add back/next links to any other module that needs them. Create a book for your cck content type and use the add to outline feature.

2) Use the views module. It is not in core, but is clearly going to be closely integrated into cck. To do this, go to admin/views and create a new view.

In the 'Page' section check that it should be displayed as a page, give it a url, select the option to display it as a full node, and set it up to show one node per page.

Ignore the 'Fields' section (not needed if you are using the node display mode) and jump to 'Filters'. Add the following filters (plus any others you want to use to limit it): Node:Published and Node:Type (mark the cck content type).

Jump to the 'Sort' section and add in the fields you want to sort on.

Save the view, then go to the url you gave it and you will see one node on a page, with back and next links.

Currently you won't see any cck fields in the list of fields, filters, and sorts, but that will be coming when the cck views support gets re-enabled. You can still see how it works now by using node fields for filtering and sorting.

kae’s picture

KarenS

Thank you
1) how does a cck type become a book? I don't see that anywhere
2) The views trick does work. 2 drawbacks. title of the view is at the top of every page. link is previous, next, not the actual titles, as is true for book in 4.7. It'd be good to have that be a choice.

karens’s picture

I don't get the title of the view at the top of every page, I get the title of the node (did you put a title into the view? If so, take it out and you will just get the node title.)

If you have book enabled, you should see a tab called "outline" on every node. Select that tab to add the node you are looking at into the book. It should work for any type of node.

jonbob’s picture

Category: feature » support
Status: Active » Fixed

Karen's solutions seem more appropriate than tying this behavior to CCK at all.

kae’s picture

I don't think views enables you to go to the top of a book, choose printer-friendly format, and print out the entire book. Drupal should definitely have that kind of functionality somewhere.

Also, does views decrease performance? I would think views would be slower than book.

There was some post that said Drupal is very hard to use. Just try to flip to the next page on anything other than a book page.

Will book.module definitely be in 4.7? In a worst case, if this kind of functionality is removed from 4.8 and later, we can just never upgrade as long as 4.7 has book.module.

jonbob’s picture

The book module will be in 4.7 without question.

edrupalec’s picture

Thank you.

Anonymous’s picture

Status: Fixed » Closed (fixed)