Closed (fixed)
Project:
Book made simple
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Apr 2012 at 13:59 UTC
Updated:
2 Jan 2013 at 15:08 UTC
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
Comment #1
MarcElbichon commentedThis can be done too by using the themed function add_child_book_content_types().
In your template.php add the following code :
Then, choose Themed function in Content type styles of BMS settings.
I can add hook if you prefer.
Comment #2
MarcElbichon commentedComment #3
mathieso commentedIt 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.
Comment #4
MarcElbichon commentedOK. Let's go for a hook !!
Commited to dev and 3.6 version
See book_made_simple.api.php for an example of implementation
Comment #5
MarcElbichon commentedIMPORTANT - 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
Comment #6
MarcElbichon commented