Thnx for this useful module.

It would be useful to have a hook that allows code to modify the list of allowed content types that appears in the "Add child" list of types on the node edit form.

The following could be around line 532 in book_made_simple.module:

    //Let other modules change allowed types list.
    $allowedTypes = module_invoke_all('filter_allowed_types_list', $allowedTypes);

My use case is to remove content types from the list, depending on a field in the book.

Comments

MarcElbichon’s picture

This can be done too by using the themed function add_child_book_content_types().
In your template.php add the following code :

function yourtheme_add_child_book_content_types($allowedTypes, $node) {
    return "HTML code of list of links";
}

Then, choose Themed function in Content type styles of BMS settings.

I can add hook if you prefer.

MarcElbichon’s picture

Status: Active » Closed (won't fix)
mathieso’s picture

It seems more like a functional thing than a look-and-feel thing. I can see an analyst saying, "We should allow these content types," and giving the task to a developer, rather than a themer.

So, for me, a hook makes sense here.

Thnx for your work on BMS. It makes book management easier for users.

MarcElbichon’s picture

Status: Closed (won't fix) » Closed (fixed)

OK. Let's go for a hook !!
Commited to dev and 3.6 version

See book_made_simple.api.php for an example of implementation

MarcElbichon’s picture

IMPORTANT - This hook has been removed in release > 3.6 in favor of drupal_alter('book_made_simple_allowed_types_list').
See book_made_simple.api.php

MarcElbichon’s picture

Project: Book made simple (Obsolete) » Book made simple