Hooks are PHP functions used to interact with the Drupal API.
1
vote
0answers
9 views
Dynamically prepend or append a path element to content urls?
Is there a way I can easily prepend a dynamic element to the beginning of content urls?
For example, I have a /photos-galleries Panel/Page which includes a View showing a bunch of photo galleries. I ...
1
vote
2answers
34 views
Commerce Hook Function To Checkout Button
I am a Drupal Commerce novice. I have a basic cart system working fine, but I now need to get into some custom code. I don't think I can use Rules because the code is a bit too complicated.
I have a ...
0
votes
1answer
27 views
How to override breadcrumbs defined by a module using a custom module?
Is it possible, using a module, to override a breadcrumd definition defined in another module's hook_node_view()?
Module property_bc sets a custom breadcrumb for nodes of type Property.
Module ...
0
votes
1answer
30 views
How do I unset hook_field_storage_load()?
I'm trying to unset hook_field_storage_load() and hook_field_storage_write() in hook_module_implements_alter() without success. Is there any other way to turn off those hooks?
0
votes
1answer
39 views
I would like to be able to trap when a particular message is sent via drupal_set_message
I would like to be able to trap when a particular message is sent via drupal_set_message like:
"•Article john mitchell article800 has been reverted back to the revision from Tue, 05/28/2013 - 10:03."
...
2
votes
3answers
41 views
How do I 'programaticaly' create a new content type with hook_install in D7?
I am trying to create a .INSTALL file which creates a content type (Apples) for my module (Fruit). I have dropped the following file (fruit.install) into my module folder with the .INFO file and ...
1
vote
1answer
19 views
How do I get block content to show?
I have a custom module that I created. In it, I've implemented the hook_block_view:
function event_details_block_view($delta = '') {
$block = array();
switch($delta) {
case 'event_details':
...
1
vote
1answer
22 views
How to install a text filter for plain_text input format
The users at my Drupal 7 website discuss a card game in plain_text comments and I'd like to format the hearts and diamonds characters by red color.
Based on the Examples module recommended to me here ...
2
votes
1answer
20 views
hook_uc_add_to_cart in template
I'm using Drupal 7 + Ubercart 3 and am trying to run a piece of code just before the user adds a product in cart. hook_uc_add_to_cart seems to be the right function to use for it. So I'm trying to ...
2
votes
1answer
40 views
How to add .active class in to the menu item?
I am developing a theme for Drupal 7 and I am struck up with the following issue. I can see there are fixes through jQuery. But I would like to do it in the Drupal way.
My current HTML
<ul ...
0
votes
2answers
28 views
Is it possible to place the output of a custom module in another module?
Is it possible to show the output of a module in another module? I have a custom module, and I want to show the block admin settings in another module. Is it possible with Drupal 7?
0
votes
1answer
17 views
do some work when user login or register in drupal6
I want to set some fields in database when user registers or login. I know I don't have to change the drupal core and I guess I should use hooks for this purpose but I don't know how and where.
...
0
votes
1answer
18 views
override variable in template.php with variable from module_preproccess_node
I create custom template for node, and put variable in template.php
$colors = array('black', 'white');
$variables['group']['color'] = $colors;
$variables['size'] = 'double';
then i also create ...
0
votes
0answers
13 views
why hook_node_view_alter does not get called for content displayed with views or panels?
Hi I am pretty new to drupal development and all the concepts.
As a test I have implemented hook_node_view_alter in my module this way:
function mymodule_node_view_alter(&$build){ ...
4
votes
2answers
120 views
Hooking into a contrib module
I've installed a contrib module in Drupal 7 and would like to hook into it. However, the documentation for the contrib module is sparse and doesn't list the available hooks, though it implies that ...
0
votes
1answer
27 views
is it possible to have upload and browse as a single button [duplicate]
is it possible to have upload and browse as a single button, for instance an image field in custom content type, there I am getting browse as a button and upload as a button, what if I need it as a ...
0
votes
0answers
14 views
add custom error code in submitted ajax webform in drupal 7
hi i am trying to add add custom error msg in the field of submitted ajax webform in drupal 7
can anybody tell me how to do it
0
votes
0answers
24 views
Custom module to assign blocks in different regions through CKEditor wizard? [duplicate]
CKEditor allows us to write our content in a style manner. We can add images from this interface also.
I am wondering whether we could also assign blocks in different regions from this interface, to ...
2
votes
2answers
65 views
Function to list all the blocks
I am searching for a function that list all the blocks that are enabled in a theme. Is there any function for this purpose?
0
votes
1answer
27 views
page “/node/add” that I would like to programmatically limit the links that are displayed based on the users role
I have a page "/node/add" that I would like to programmatically limit the links that are displayed based on the users role. Is using either hook_form_alter or hook_form_ID_alter the way to do this?
I ...
-1
votes
1answer
22 views
How to use predefined drupal elements in a custom block/module?
This is regarding the user block but the question is general and could be related to any standard block/module: How to use in a custom block elements that have been defined in standard modules? (for ...
0
votes
1answer
15 views
Getting $head_title in my module
I am building a module that requires me to get the $head_title variable in the hook_node_view for some processing...I have found info about that variable in relation to themes and around core, but not ...
0
votes
2answers
69 views
Assign text formats per user roles
I tried to program the logic where friends_html text format would apply to nodes saved by users with the new 'friends' role, while friends_somik_my_html text format would apply to nodes saved by all ...
2
votes
1answer
33 views
array_flip() error while creating a menu item with form
My aim is to create a new menu item and display the user profile form on that page.
Here is the code I am using.
/**
* Implements hook_menu().
*
*/
function profile_preferences_menu(){
...
1
vote
2answers
39 views
Custom Login form question
In my website have two types people login one is designer another is reader, i want people come to login my website by role. Mean designer go to design login form to login. Reader go to reader login ...
0
votes
2answers
34 views
curent language token on block body
what is the token used to get the curent language, I want to use this token on a link in the block body, like that:
<a href="/[curent-language]/about-us">About us</a>
I find this token ...
0
votes
1answer
13 views
Additional fields for Ubercart uc_order_product
I need to add fields to the Ubercart entity uc_order_product. I was looking into the function field_create_instance, but don`t know exactly where to use it. I believe I should attach the field I want ...
4
votes
1answer
48 views
How to alter node title link?
I want alter $node_url in node.tpl.php inside a module not in node.tpl.php, which hook should I use?
0
votes
1answer
35 views
How to rewrite the value of an array element in page.tpl.php
I'm totally new to PHP programming and modifying the values of Drupal output with php customisations, so sorry if this question seems dumb.
In Drupal 6 I need to rewrite the value of the array ...
0
votes
1answer
20 views
working with LDAP authorization hook
While I have been able to use the LDAP authentication hook
(hook_ldap_authentication_allowuser_results_alter) to perform additional authentication,
I have not been able to use what I thought was the ...
0
votes
1answer
33 views
how to get form element value before submit in drupal
i have form has first name and last name field,and a custom login form,when user login it redirect to another page,and i want to get first name and last name fields in that page..,
this is the way ...
1
vote
1answer
24 views
How to add a custom widget to a node creation form Drupal 6
This may be a dumb question, but nothing I could find really told me what I was looking for. Without furthur ado:
I need to add a custom widget that will edit node reference fields on CCK content ...
0
votes
0answers
23 views
How to create a form inside a form which is created in a custom content type
I've created a custom content-type using hook_node_info. Now in that hook_node_info I've declared 'base' as some test. Now i want to create a form. For that I've used hook_form which is "test_form" ...
0
votes
1answer
20 views
How Can I change the fields order without using CCK
I want to change the order of the fields in each node. I know that I can use CCK but I would like to do this in hook_node_load
Is it possible?
Thx :)
0
votes
2answers
84 views
Guidelines on customisation options when using hook_views_default_views?
Are there any good instructions for the customisation options available when creating a default Views files using hook_views_default_views()?
The API for the function can be found here:
...
1
vote
0answers
18 views
Calling a hook from a hook in the same module
Hey guys I am a Drupal Noob so be easy on me. I have created several custom modules with different forms however I was all the time using either a hook_form or hook_output. I was wondering if I can ...
1
vote
2answers
31 views
how to add html elements inside block and get data when saving
i want to add few html elements call first name and last name,company name in top of user/register page and save that data when user click create account button..,how can i achieve that,i add html ...
1
vote
1answer
44 views
Error displaying field_view_field content [duplicate]
I have some working but drupal keeps giving me warming errors each time i look at the admin pages.
I am in the process of building a forum using drupal's core forum module. Once you selected a listed ...
0
votes
0answers
12 views
Term Reference Update Event
I Have implemented a term reference field in my custom content type. The widget i am using is hierarchical select. Now when a content type is being created a hierarchical select box is shown, if a ...
0
votes
1answer
20 views
Using drupal_add_content_region()
I am trying to dynamically add content into a region.
In the preprocess function, I use the following code.
function firsttheme_preprocess_page(&$vars){
drupal_add_region_content('dev', ...
0
votes
2answers
63 views
Can we call a custom block inside our hook_block_view()?
I have a module of type block.Now based on the user i want to display different blocks .
So i have a written the module but my dilemma is if its possible to call a block(default) inside our custom ...
1
vote
1answer
75 views
How do I prepopulate the value of a taxonomy term reference field on the node creation form?
I'm using an approach similar to the one taken in this question. The difference is that I have a taxonomy term reference field in the user profile that I want to use to prepopulate a custom content ...
0
votes
0answers
16 views
How to create a link for certain user roles to modify a field of a node?
I have a content type called "orders". Users can create orders, admins can list orders (via a view). What I want to do is add a link or button both on the view and the content page of "order" to let ...
1
vote
1answer
38 views
How can I limit a views_pre_render() to a specific display of a view?
I have a views_pre_render() hook that I want to limit to a specific views display.
So far, based on this code, I have this:
function MYMODULE_views_pre_render(&$view) {
if ...
0
votes
0answers
35 views
Background Image from a specific Content Type
I'm fairly new to Drupal and got the following problem:
The User should be able to upload as many background images as he likes. He can tag the background images for a specific region of the website ...
2
votes
1answer
31 views
How do you change what a function in a core module does?
I am trying to change certain Drupal behavior. I have traced this behavior back to a function in RDF core module, and would like to change what it does. The function in question is ...
1
vote
1answer
33 views
Change drupal search result count
Drupal search is giving 10 items per page. The number is hard coded in search core module. Is there any way to make it 15?. I am using drupal 6.
1
vote
1answer
48 views
Add content type machine name to an attribute in the body tag?
I figured this would be easily done in the template_preprocess_html function, but I haven't found a way to do it... yet.
I need to add the content type machine name to a "data-init" attribute in the ...
0
votes
2answers
29 views
hook_filter_info langcode is always und
I am trying to filter text and the result replace depends on the language of the node.
The filter process callback function accepts $langcode argument but it always pass as "und".
If I could access ...
0
votes
0answers
31 views
Jquery Mobile module page change not detectable?
I'm implementing a mobile version of an existing site. I'm using the jquerymobile module to make this happen. The constraints of the problem are:
The main site has a header that appears on every ...