Users should be able to specify that a skeleton has a manual book introduction, or instead specify a template to use. Ideally, a user shouldn't have to enter anything other than the name of the book when instantiating a skeleton.

Comments

deviantintegral’s picture

Status: Active » Needs review
StatusFileSize
new8.89 KB

Here is a patch which implements this feature.

It works by checking to see if only one template is the parent. If it is, then by default it is used as the book introduction page. To create an introduction page, simply check off the "Add an introduction to this book" checkbox. If more than one template is the parent, then nothing is changed.

This still needs to handle the case where javascript is disabled.

deviantintegral’s picture

StatusFileSize
new13.06 KB

Here is an updated patch which works with JavaScript disabled. Changes include:

  1. The checkbox had to be changed to a submit button as you can't bind a submit action to a checkbox and I didn't want to add both a checkbox and another "update" button.
  2. I had to use a custom validation function so that #required fields aren't validated when toggling the introduction status.
  3. I added some JavaScript to capture the submit action caused by pressing the enter key when javascript is enabled, and redirect it to the actual submit button. Otherwise, pressing enter with JS enabled would trigger the JS-disabled submit action.
deviantintegral’s picture

StatusFileSize
new13.22 KB

Here is an updated patch which actually allows the custom information to be used as it was checking for a variable which no longer exists.

deviantintegral’s picture

Status: Needs review » Fixed

Committed to HEAD.

Status: Fixed » Closed (fixed)

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

stefan81’s picture

Status: Closed (fixed) » Fixed

hi, actually its exactly this what I am looking for :)

I would like to test it.
Is it already implemented at version 6.x-1.0-alpha1 ?

stefan81’s picture

sorry, finally found out how it works (6.x-1.x-dev)

stefan81’s picture

But I get this error on instance creation:

"There is no new content."


	•	warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'book_node_form' was given in /includes/form.inc on line 372.
	•	warning: Invalid argument supplied for foreach() in /sites/all/modules/skeleton/skeleton_instance.inc on line 792.
	•	warning: array_merge() [function.array-merge]: Argument #2 is not an array in /sites/all/modules/feeds/includes/FeedsConfigurable.inc on line 105.
	•	warning: array_intersect_key() [function.array-intersect-key]: Argument #1 is not an array in /sites/all/modules/feeds/includes/FeedsConfigurable.inc on line 107.
	•	warning: Invalid argument supplied for foreach() in /sites/all/modules/feeds/plugins/FeedsCSVParser.inc on line 27.
	•	warning: Invalid argument supplied for foreach() in /sites/all/modules/cck/content.module on line 1308.
	•	warning: Invalid argument supplied for foreach() in /sites/all/modules/cck/content.module on line 1348.
	•	warning: Invalid argument supplied for foreach() in /sites/all/modules/cck/content.module on line 1348.
	•	warning: Invalid argument supplied for foreach() in /sites/all/modules/cck/includes/content.token.inc on line 39.
	•	An illegal choice has been detected. Please contact the site administrator.
	•	warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '_node_form' was given in /includes/form.inc on line 372.

I am running CCK 6.x-3.x-dev
Could this be the problem?

Status: Fixed » Closed (fixed)

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