Hooks are PHP functions used to interact with the Drupal API.
0
votes
1answer
26 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
26 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
13 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
20 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
28 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
29 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
24 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
36 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
25 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
17 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 ...
1
vote
1answer
16 views
Target Bundle with hook_element_info_alter
Using the following hook you can alter form elements
function EXAMPLE_element_info_alter(&$type){
// Increase the default weight range
if (isset($type['weight']['#delta'])) {
...
2
votes
1answer
41 views
drupal 6 search pdf content
Is there any way include pdf files in common drupal search. I tried http://drupal.org/project/search_files module. But it gives the results under a separate tab. Is there any to include them in common ...
1
vote
1answer
21 views
how to alter block subject html tag?
I am trying to change the <h2> tags that block.tpl.php uses to wrap <?php print $block->subject ?> to <h3> tags so that I can target them with jQuery UI Accordion. I've got the ...
0
votes
0answers
20 views
How to set Content-Lenght http header for images?
How to set the Content-Lenght header or any other header for images?
I need it to set a rule in the varnish to not cache images larger than 500kb.
1
vote
1answer
40 views
which hook to change the node order in a view?
I have a custom view but now I want to put the nodes created by a specific user role on top.
I want to do this using code so I can easily implement this throughout multiple web pages.
I'm thinking ...