Search code examples
drupal-6drupal-fapidrupal-node-hook

Drupal cck checkbox with global setting


I am creating a "sticky" checkbox for my content type "news". this means that one news node is sticky, and is used in a banner like box.

This is marked by a checkbox int the cck create content form.

The checkbox is handled by the node_api,

so I check: if $op = 'update' and $node->type = 'news' then ... logic.

I don't know why but this doesn't seem like the best way to do it, because all my noe handling is done there.

Is ther a more logic way/place to handle this ?

@edit,

I also have to create an extra module to activate this. I have a "general" module which handles a few of this general things"


Solution

  • I created a set_variable for the sticky which stores the Node_ID.

    This way, when I make a content Item sticky all the rest is made "Unsticky".

    Works like a charm.