The 'password protect this [content type]' field is not listed in the 'manage fields' page of the
content types. Therefore it cannot be placed in the correct position on the content creation page.

It just seems to appear in a random position. For instance, the field appears in a different
position on my two of my content type creation pages, even though they both have exactly
the same fields in exactly the same positions.

Does anyone know how I can control the positioning of the 'protected node' field?

Thanks.

Comments

chianti’s picture

Sorry, just to add the correct terminology this question...
Apparently I am talking about the 'weight' of the 'password protect' field.
It doesn't appear on the 'managed fields' page, and therefore cannot be
given a new 'weight' by drag/drop, and so it is appearing in a seemingly
random position on the content creation page.

At the moment, on one content type it is right at the top (very, very annoying),
whilst on the other it is below the body, but placing itself between my image
upload and attachment upload fields, which are supposed to be beside each other.

If anyone knows how to give the 'password protect' field a custom weight and
so position it where it is supposed to be, I'd love to know in the next five hours.
I've got to present this website tomorrow morning, and I'm not looking forward to
explaining why I can't control the layout of the creation form.

Thanks.

AlexisWilke’s picture

It must be because of this test. If it is false when you go to CCK, then it won't add the password fields and thus not be visible to the CCK code.

function protected_node_form_alter(&$form, &$form_state, $form_id) {
  if (isset($form['type']['#value']) && $form['#id'] == 'node-form' && (user_access( 'edit protected content' ) || user_access( 'edit protected ' . $form['type']['#value'] ))) {
AlexisWilke’s picture

Assigned: Unassigned » AlexisWilke
Status: Active » Fixed

Okay. The module supports CCK. You can move the field that way. Note that the system still forces certain fields in certain positions, no matter what. If you really want to force the weight to a certain value, you'll have to edit the code and change the weight manually (i.e. '#weight' => 123).

Thank you.
Alexis Wilke

Status: Fixed » Closed (fixed)

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

chianti’s picture

I just saw this was updated.
Thank you very much for the fix Alexis. Much appreciated.