Active
Project:
Booktree
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Sep 2012 at 10:19 UTC
Updated:
20 Dec 2012 at 09:15 UTC
Is there a way to get the content (specifically the displayed tree) generated by booktree in another node?
I have a page with some text and would like to include the generated tree as a sort of table of contents with something like:
$node = node_load( '/?=booktree' );
$nodeout = drupal_render(node_view( $node, $view_mode = 'full' ));
print $nodeout;
(which is not working)
A plus would also be if you could specify the settings as is suggested for the usage in the url, e.g.:
$node = node_load( '/?=booktree[/<root-node>[/<depth>[/<trim-length>]]]' );
$nodeout = drupal_render(node_view( $node, $view_mode = 'full' ));
print $nodeout;
Comments
Comment #1
bellerophons_pegasus commentedAfter a lot of research I found a solution that works for me.
In booktree.module, right before function booktree_menu(), I added:
This creates a block that is shown in the blocks menu and can be configurated.
To add the content of this block into the content of a specific page just add following code in the place you want:
Maybe there is a better solution to this?
Comment #2
bellerophons_pegasus commentedInserting the content of a block with php only works well, when using a MySQL database. With other databases you may get weird errors.