Download & Extend

ToC for page generated from collection of CCK text fields

Project:Table of Contents
Version:6.x-3.1
Component:User interface
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hello,
After a search of this site failed to find a solution, I'm hoping someone here might be able to help me.
I have created a content type that produces a collection of nodes/pages with several sections by using CCK text fields. The reason I used several text fields instead of one single field for the body of text is to make it simpler to reorder/remove any sections if necessary in the future.
How can I create a single table of contents for the entire page that is made up of headings from each section/text field using this module? If not this module, can anyone please suggest an alternative solution?

Any help would be much appreciated - thanks.

Dennis

Comments

#1

(comment removed)

#2

Dennis,

I suggest you look into views, insert_views, and this module.

The views create the page with header.

The insert_views help you insert the result in a node.

This module generates the table of content.

Thank you.
Alexis

#3

Thanks very much for the quick reply, Alexis.
I will give this a try and post my results.

Regards,
Dennis

#4

Well for the most part, I have this working well using the above combination of modules. The one thing I haven't been able to figure out is how to dynamically filter the data set to display only the specific information I want from the content type. I've set the Argument setting in the view to Node:Title but I have to manually supply the title argument into the insert view tag.
e.g. [view:my_view==abc] --> create the view using data set from node titled abc.

Is there any way to tokenize the argument so that it will supply the argument parameter based on the title of the node I'm inserting the view into?
In other words, I want to insert the view into the node titled 'def' and I want the title to be somehow automatically inserted into the view tag.

I was going to post this in the Insert Views issues but I thought I'd try here first.

Thanks,
Dennis

#5

You may want to look for tag modules and test. As long as you place the tag filter before the insert view filter, it should work as in:

[view:my_view==[node:title]]

But I'm personally have never been able to make the main tag module work for me.

Thank you.
Alexis

#6

Hi Alexis,
I looked at the Token and Token Filter modules for a working solution but unfortunately, node tokens won't work with the filter (I assume you meant Token and not 'Tag' modules).
See #474424: Code doesn't verify the value entered by the user, and calls token_replace() with the wrong arguments
So I guess I'm stuck with entering the argument manually.

Thanks for your help,
Dennis

#7

Dennis,

I tried to use the Token module and failed miserably. I totally gave up probably because I don't understand how it works. After all, there are other modules using it successfully, so it must be somewhat working. Notice that #474424 was marked as "won't fix." So that is not a bug. Probably considered a improper use of the module, even though many people reported problems using it...

Anyway, if you cannot find another solution, I can update my MO Tag module so it does exactly what you need. And yes, that module is not free. Yet, I have a very good handle on it... 8-)

The update would not take very long (1 or 2 days).

Thank you.
Alexis

#8

Thanks for the advice, Alexis.
For the time being, I'll enter the argument manually as part of the syntax to render the TOC in the node. However, I'll keep the MO Tag module in mind (and others now that I know of your existence) if I need another solution.

Regards,
Dennis

#9

Status:active» fixed

At this point, I'll mark this fixed.

With the newer version of the module you should also be able to use the Content type feature to get this to work.

Thank you.
Alexis Wilke

#10

Status:fixed» closed (fixed)

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

#11

Hi Alexis,

Could you be more specific about using the Content type feature of the newer version of the (ToC?) module to resolve this issue?
I'm not sure what you mean.

Thanks,
Dennis

#12

Dennis,

Go to Administer » Content management » Content types and click on the content types where you want a Table of Contents. In that form, you will see an entry for the Table of Contents to automatically be added. This feature does not use the filter. Instead, it uses the last hook the node module offers to change the output contents.

Thank you.
Alexis

nobody click here