Strange behaviour of drupal 6 triggers and CCK default values

Leave a comment

One of my drupal experience is to developing an application for a client.So i want to change the default behaviour of drupal after saving the post.I created a trigger which triggers after saving the post to Redirect the admin/content/node Url.But the bad behaviour is starts there.The application dont save default values,but after editing and save it saves the values.So i used a hook_nodeapi to get the values from submitted form and try to save it.But ‘mymodule_nodeapi’ not fires at all.Before that it redirect to the ‘triggered Url’.After many hours of  research, trial,  i found the redirect nature and Un assign the Trigger .Now it works perfectly.

Buti am not 100% sure if it only related to that trigger or some thing related to configuration of trigger.

i will update my further finding and experience of drupal as application frame work in future

How to add CCK date field as filters in drupal view with default values

Leave a comment

create view and add fields,sort criteria etc

step 1 : select group as ‘Date’ then Date:node,add it to the filter by clicking the add
step 2: set Date form type: as text,granularity as day,from
‘Date field(s):’ select the CCK field you want and select method ‘AND or OR’,click update
step 3:Here is the trick
Operator: as you like (i am selected ‘is less than or equal to(for avoid post dated pubblications)’.
Attention for default value:
put your default value in ‘Date default:’ (i am used ‘now’ for current date,other values as ‘now +1 day’).

and update it .Now you have a view filterd by CCK date field

 

 

custom cck check box and default values and label

Leave a comment

For making cck check box field with label and default value,tricky way is there.You must pass ‘Allowed values list:’ as a key value pair separated with ‘|’.

eg:1|label

2|label

Then it shows proper label when editing the story.