By dragon2000 on
Hi,
When installing Poll module, "poll content type" goes to front page by default, I want to change this behavior. I know by unchecking the "promoted to front page" checkBox they won't go to front page anymore. but I want this to happen by default.
shall I manipulate and change the core module or write another module to override this?
what is your opinion?
thanks in advance.
Comments
Visit Administer › Content
Visit Administer › Content management › Content types
For "poll content type" click "edit"
Under "Workflow setting" make sure "Promoted to front page" is unchecked.
thank you, But I want to give
thank you,
But I want to give this module to my customers, and I want they get ride of this settings.
So as I said shall I manipulate and change the core module or write another module to override this?
what is your opinion?
Never touch the core files.
Never touch the core files. Your changes will be overwritten anytime you update versions. So write a module to do it.
Contact me to contract me for D7 -> D10/11 migrations.
thanks, my question is how
thanks,
my question is how can I write a module to change the settings of another module?
That's the subject of whole
That's the subject of whole books, not just individual threads. There are various hook_something_alter() functions you can use.
But in this case, I imagine it's as simple as changing one column of one row in the database somewhere from 0 to 1, or vice versa. You just have to figure out where in the database the default value for posting polls to the front page is, and then write a module that changes that value to the other. So you won't really need to use any hooks or anything.
Contact me to contract me for D7 -> D10/11 migrations.
Sorry for the hijacking the
Sorry for the hijacking the thread but as my question relates to overriding existing module values I thought to post here.
What if I want to create a new content type that uses locative information with custom default values for e.g. number of locations drop down lists with min = 1, max = 1 and add = 1?
I tried to override these location module defaults by mymodule_node_info() with this data appended to array:
'location_settings' => array(
'multiple' => array(
'min' => 1,
'max' => 1,
'add' => 1,
),
),
But as that didn't work I was hoping if someone could help me with this problem.
Not really sure what you are
Not really sure what you are asking, but if you want to override a modules form to add values to it, you need to use hook_nodeapi().
Contact me to contract me for D7 -> D10/11 migrations.
Ok, I'll clarify: If I have
Ok, I'll clarify:
If I have enabled location module and go to edit my custom content type there is also locative information shown. I would like to override some of these default values provided by location module.
Check out hook_nodeapi().
Check out hook_nodeapi(). This hook is used for hooking into other modules. You can change the values inside $node to set them to what you want. You will have to figure out how to target the location module specifically, but if you play around with it for a bit, I'm sure you can figure it out.
To see what's contained inside of $node, I often use this trick myself.
This will print out an easy to read list of everything contained inside $node. From there you can start playing with settings, figuring out which ones you need to change to do what you want.
But the first thing you should do is read through the documentation for hook_nodeapi() to get an idea of how it works.
Contact me to contract me for D7 -> D10/11 migrations.
Thanks! I will check that.
Thanks! I will check that.
Using module_nodeapi() does
Using module_nodeapi() does not allow changing much of $node. I tried changing the module weights too in the system table but that didn't help.
I would like to stay out of the location.module file if possible. Any clues how to make this happen?