drupal

Add menu item/link to Drupal menu (programatically?)

Hello I have a Drupal Menu which I created through the interface. I wish to add an entry which says Hi, John Doe Where John Doe is a link to the User's profile page. I would like to do this programatically or if it can be done through the interface then that would be great. Any help is appreciated. ...

Need help to make and query cost matrix table?

I had built a website for my client with Drupal 6 . Now he wants to query cost of his service from one town to another town. I know basics of CCK and Views. I will need two select box for towns and show cost of between two towns and a way to let customer enter cost between towns. What is the easiest way of doing it in Drupal ? I am a ja...

Should I use Module Uninstall menu?

After months using Drupal for my websites I noticed module uninstall tab in the modules list. I've always uninstalled my modules by deleting their folders from filesystem (after disabling them). I was wondering if this is the wrong way to remove them. Thanks ...

Overriding the user registration form in Drupal 6

I want to be able to customise the user registration form in Drupal 6 I have found thousands of tutorials that show me how to override the structure in which you can output the form as a whole, but I want to move form elements around etc and I cant quite seem to see the best way to do this ...

query to ignore first 2 rows

i have a query to fetch 100 rows of events ordered by timestamp. i want to ignore top 2 entries from the result set. The problem is that there is no criteria match (simply to ignore first 2 rows). i am using pager (drupal) which results 10 events per page. If i process it after fetching 10 rows i lost 2 entries (first page contains onl...

How set a htmlarea to some specific textarea ,instead of all textarea

I have a drupal site. And i have intsalled a htmlarea module and it worksfine. Now all textarea in the form changed into htmlarea. How is possible to change only some particular textarea to htmlarea. ...

Select a template through the admin area?

Up to now, I've always hard coded what page template a certain page should use, either based on the URL, or what type of node it is. What would be really useful is if there was a way to select which tpl file to use, right there in the node edit form. This would allow the user to flick between different page layouts at will. Does anyone...

drupal reading array type fields

I have a multi value cck field. I can read any single id with node->field_multip[0][id]. How do I read all ids? I tried a for loop with field_multip.length but the page never finishes loading. What's the right way of doing this? field_multip [0] [id] [sec] [1] [id] [sec] [2] [id] [sec] ...

finding length of multi-value field

I have a multi-value cck field in a drupal node. The field is called field_multip. I need to know the number of items in this field, for example 3 in the case below I would have thought that length would do the trick, but neither $node->field_multip.length nor $node->field_multip.length() worked for me. field_multip [0] [id] ...

Migating from CakePHP to Drupal, functionality question.

Hi, (I've posted this on the drupal forum too btw) I'm converting the company websites to use Drupal, or at least trying to check that its going to be the best way forward. I have a background in PHP development, and I'm currently using the CakePHP framwork. I've built this site (not my design) and I can see how to replicate most of the...

Search hook isn't working correctly

I'm trying to use hook_search to extend the built in drupal search to explicitly link two content types. ex. items a and b are part of collection a. Currently if you search for the title of collection a you only get collection a. I'd like to extend the search so that you get items a & b as well because they are members of that collect...

How do I edit link tabs found on the default user profile page in drupal?

How do I edit link tabs found on the default user profile page in drupal? I'm trying to avoid having to create a user_profile.tpl.php file and rebuild the entire profile from scratch. If there's an easier way to do this, I'd rather do that. But, if I'm forced to create a custom template, how do I control the menu tabs for the profile? I ...

Add subitem to second level

I have primary links created manually. The are links to node (content type 'page') like -About --About Us --About company I need to add subitems About/About company/company1 and About/About company/company2 from my module. Next lines create menu item in first level (in one level with -About) $items['about2'] = array( 'menu_name' ...

What to put in "type" when adding new content to node via $node->content

I'm adding new content to a node, but I'm stuck on what to put in #type. I know that when you're dealing with a profile page for example, you would put '#type' => 'user_profile_item' but what to put for new content on a node? $node->content['newc'] = array( '#type' => , //what to put here for type '#title' =>...

Link to download an image or other file, next to a link that opens a new tab with the image

I'm building an image gallery. Under the images, I want to display links under each image where one says "View full image" and another one says "Download image". Is it possible? EDIT: I realized that I've provided insufficient information. The images in my gallery have three sizes. The smallest are displayed with views. The medium is di...

Importing 60,000 nodes :(

hi, I'm using Table Wizard + Migrate module to import nodes into my Drupal installation. I need to import around 60,000 questions / answers (they are both nodes) and I thought it would have been an easy task. However, the migrate process imports 4 nodes per minute, and it would take approximately 11 days to finish the importing. I wa...

Update various groups on new post using Views, Organic Groups and the Live Update API

Hi I have several different groups which my users can subscribe to. When they are logged in their mainpage will be /frontpage which is a Views generated view based on the users subscribed groups and it shows the latest activity across those groups. I am using the Live Update API to show new content whenever it is posted. As it is now i...

Can you find which part of drupal handles form submit automatically?

No matter where the form is submited, the submited handler is called. Anyone knows this? ...

Customise output of $content in Drupal nodes

I have a custom content type called 'business-profile' and I have the template files 'node-business_profile.tpl.php' which works fine, but I want to be able to edit the layout of the $content variable ie I want display some elements in particular divs etc What is the best approach? ...

drupal 6 and nodequeue_nodes

hi to all, I'm migrating a drupal web portal from old release(5.22) to a new release(6.17). I've some problem with nodequeue module: d6 version of this module has not the nodequeue_nodes function... How can I substitute this function? Thanks in advance. Regards, Michele ...